aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mapi/stub.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-03-05 23:40:39 +0100
committermarha <marha@users.sourceforge.net>2015-03-05 23:42:09 +0100
commitc646056120fe14e4c4ccf81bac5d78d61225a8e8 (patch)
treeba0af42750f0ab6dc4724342a7063835636222b5 /mesalib/src/mapi/stub.c
parent87e58a93f7248171e736656080069cb65ff56aae (diff)
parent8574eba804031f6b19713f0b02952280730bf62e (diff)
downloadvcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.gz
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.bz2
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/drivers/dri/swrast/swrast.c mesalib/src/mesa/main/.gitignore mesalib/src/mesa/main/queryobj.c
Diffstat (limited to 'mesalib/src/mapi/stub.c')
-rw-r--r--mesalib/src/mapi/stub.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/mesalib/src/mapi/stub.c b/mesalib/src/mapi/stub.c
index dfadbe1a5..05436bab6 100644
--- a/mesalib/src/mapi/stub.c
+++ b/mesalib/src/mapi/stub.c
@@ -28,14 +28,14 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include "c11/threads.h"
+#include "util/macros.h"
#include "u_current.h"
-#include "u_thread.h"
#include "entry.h"
#include "stub.h"
#include "table.h"
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
struct mapi_stub {
const void *name;
@@ -54,16 +54,8 @@ static int next_dynamic_slot = MAPI_TABLE_NUM_STATIC;
void
stub_init_once(void)
{
-#ifdef HAVE_PTHREAD
- static pthread_once_t once = PTHREAD_ONCE_INIT;
- pthread_once(&once, entry_patch_public);
-#else
- static int first = 1;
- if (first) {
- first = 0;
- entry_patch_public();
- }
-#endif
+ static once_flag flag = ONCE_FLAG_INIT;
+ call_once(&flag, entry_patch_public);
}
static int