diff options
author | Brian Paul <[email protected]> | 2015-03-04 19:17:57 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-03-05 06:59:43 -0700 |
commit | 9385c592c68e7304cd9084fe17f27ec17319cdcf (patch) | |
tree | 3aadc5de83850af395c7c77875d4007d87fc240a /src/mapi/u_current.c | |
parent | 262cd683e22ec64645a50b558f91001b75ea2000 (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/u_current.c')
-rw-r--r-- | src/mapi/u_current.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mapi/u_current.c b/src/mapi/u_current.c index 036572483c2..7e7e275f2e3 100644 --- a/src/mapi/u_current.c +++ b/src/mapi/u_current.c @@ -48,8 +48,8 @@ * drivers! No changes to the public glapi interface. */ +#include "c11/threads.h" #include "u_current.h" -#include "u_thread.h" #ifndef MAPI_MODE_UTIL @@ -112,8 +112,8 @@ struct mapi_table *u_current_table = (struct mapi_table *) table_noop_array; void *u_current_context; -struct u_tsd u_current_table_tsd; -static struct u_tsd u_current_context_tsd; +tss_t u_current_table_tsd; +static tss_t u_current_context_tsd; static int ThreadSafe; #endif /* defined(GLX_USE_TLS) */ @@ -124,8 +124,8 @@ void u_current_destroy(void) { #if !defined(GLX_USE_TLS) - u_tsd_destroy(&u_current_table_tsd); - u_tsd_destroy(&u_current_context_tsd); + tss_delete(u_current_table_tsd); + tss_delete(u_current_context_tsd); #endif } @@ -135,8 +135,8 @@ u_current_destroy(void) static void u_current_init_tsd(void) { - u_tsd_init(&u_current_table_tsd); - u_tsd_init(&u_current_context_tsd); + tss_create(&u_current_table_tsd, NULL); + tss_create(&u_current_context_tsd, NULL); } /** @@ -233,7 +233,7 @@ u_current_set_context(const void *ptr) #if defined(GLX_USE_TLS) u_current_context = (void *) ptr; #else - u_tsd_set(&u_current_context_tsd, (void *) ptr); + tss_set(u_current_context_tsd, (void *) ptr); u_current_context = (ThreadSafe) ? NULL : (void *) ptr; #endif } @@ -249,9 +249,7 @@ u_current_get_context_internal(void) #if defined(GLX_USE_TLS) return u_current_context; #else - return (ThreadSafe) - ? u_tsd_get(&u_current_context_tsd) - : u_current_context; + return ThreadSafe ? tss_get(u_current_context_tsd) : u_current_context; #endif } @@ -273,7 +271,7 @@ u_current_set_table(const struct mapi_table *tbl) #if defined(GLX_USE_TLS) u_current_table = (struct mapi_table *) tbl; #else - u_tsd_set(&u_current_table_tsd, (void *) tbl); + tss_set(u_current_table_tsd, (void *) tbl); u_current_table = (ThreadSafe) ? NULL : (void *) tbl; #endif } @@ -287,7 +285,9 @@ u_current_get_table_internal(void) #if defined(GLX_USE_TLS) return u_current_table; #else - return (struct mapi_table *) ((ThreadSafe) ? - u_tsd_get(&u_current_table_tsd) : (void *) u_current_table); + if (ThreadSafe) + return (struct mapi_table *) tss_get(u_current_table_tsd); + else + return (struct mapi_table *) u_current_table; #endif } |