summaryrefslogtreecommitdiffstats
path: root/src/mapi/mapi.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-05 16:06:00 -0700
committerBrian Paul <[email protected]>2014-03-06 07:53:06 -0700
commit84094a273e3ceeead5b6c86d3d8244374ea6fb1c (patch)
tree8cb0771255a1074c9d903dcfd8ddb3334b78b106 /src/mapi/mapi.c
parent846a7e86309ab3877af6b7d3a63880468dfacbd3 (diff)
glapi: remove u_mutex wrapper code, use c99 thread mutexes directly
v2: fix initializer mistake spotted by Chia-I Wu. Reviewed-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/mapi/mapi.c')
-rw-r--r--src/mapi/mapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mapi/mapi.c b/src/mapi/mapi.c
index 6f1b35fa425..aa6b91b42c7 100644
--- a/src/mapi/mapi.c
+++ b/src/mapi/mapi.c
@@ -72,15 +72,15 @@ get_stub(const char *name, const struct mapi_stub *alias)
void
mapi_init(const char *spec)
{
- u_mutex_declare_static(mutex);
+ static mtx_t mutex = _MTX_INITIALIZER_NP;
const char *p;
int ver, count;
- u_mutex_lock(mutex);
+ mtx_lock(&mutex);
/* already initialized */
if (mapi_num_stubs) {
- u_mutex_unlock(mutex);
+ mtx_unlock(&mutex);
return;
}
@@ -90,7 +90,7 @@ mapi_init(const char *spec)
/* parse version string */
ver = atoi(p);
if (ver != 1) {
- u_mutex_unlock(mutex);
+ mtx_unlock(&mutex);
return;
}
p += strlen(p) + 1;
@@ -115,7 +115,7 @@ mapi_init(const char *spec)
mapi_num_stubs = count;
- u_mutex_unlock(mutex);
+ mtx_unlock(&mutex);
}
/**