mapi: use c11 call_once() instead of pthread_once()

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Brian Paul 2015-03-04 19:17:57 -07:00
parent 18db13f586
commit 262cd683e2

View 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
}