summaryrefslogtreecommitdiffstats
path: root/src/mapi/stub.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-03-04 19:17:57 -0700
committerBrian Paul <[email protected]>2015-03-05 06:59:43 -0700
commit9385c592c68e7304cd9084fe17f27ec17319cdcf (patch)
tree3aadc5de83850af395c7c77875d4007d87fc240a /src/mapi/stub.c
parent262cd683e22ec64645a50b558f91001b75ea2000 (diff)
mapi: remove u_thread.h
Just use c11 threads directly. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mapi/stub.c')
-rw-r--r--src/mapi/stub.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mapi/stub.c b/src/mapi/stub.c
index 953b6c75c31..05436bab6d3 100644
--- a/src/mapi/stub.c
+++ b/src/mapi/stub.c
@@ -28,10 +28,10 @@
#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"
@@ -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