mapi: use c11 call_once() instead of pthread_once()
authorBrian Paul <brianp@vmware.com>
Thu, 5 Mar 2015 02:17:57 +0000 (19:17 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 5 Mar 2015 13:59:43 +0000 (06:59 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mapi/glapi/glapi_entrypoint.c

index 53104ce5e58ab7bbb2b5d405a15b38f86d1b1313..7facd8aca4479824b021a848bbaab8811c27feae 100644 (file)
@@ -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
 }