summaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-03-04 19:17:57 -0700
committerBrian Paul <brianp@vmware.com>2015-03-05 06:59:43 -0700
commit262cd683e22ec64645a50b558f91001b75ea2000 (patch)
treec71f6e30c63323bc9e10e3ffd50bbae2cc963d76 /src/mapi
parent18db13f586509f4fc196839886efcfd0715d8db0 (diff)
downloadexternal_mesa3d-262cd683e22ec64645a50b558f91001b75ea2000.zip
external_mesa3d-262cd683e22ec64645a50b558f91001b75ea2000.tar.gz
external_mesa3d-262cd683e22ec64645a50b558f91001b75ea2000.tar.bz2
mapi: use c11 call_once() instead of pthread_once()
Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/glapi/glapi_entrypoint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c
index 53104ce..7facd8a 100644
--- a/src/mapi/glapi/glapi_entrypoint.c
+++ b/src/mapi/glapi/glapi_entrypoint.c
@@ -29,6 +29,7 @@
*/
+#include "c11/threads.h"
#include "glapi/glapi_priv.h"
#include "u_execmem.h"
@@ -336,7 +337,7 @@ void
init_glapi_relocs_once( void )
{
#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
- static pthread_once_t once_control = PTHREAD_ONCE_INIT;
- pthread_once( & once_control, init_glapi_relocs );
+ static once_flag flag = ONCE_FLAG_INIT;
+ call_once(&flag, init_glapi_relocs);
#endif
}