• Home
  • Raw
  • Download

Lines Matching refs:store

20 void*  thread_store_get( thread_store_t*  store )  in thread_store_get()  argument
22 if (!store->has_tls) in thread_store_get()
25 return pthread_getspecific( store->tls ); in thread_store_get()
28 extern void thread_store_set( thread_store_t* store, in thread_store_set() argument
32 pthread_mutex_lock( &store->lock ); in thread_store_set()
33 if (!store->has_tls) { in thread_store_set()
34 if (pthread_key_create( &store->tls, destroy) != 0) { in thread_store_set()
35 pthread_mutex_unlock(&store->lock); in thread_store_set()
38 store->has_tls = 1; in thread_store_set()
40 pthread_mutex_unlock( &store->lock ); in thread_store_set()
42 pthread_setspecific( store->tls, value ); in thread_store_set()
48 void* thread_store_get( thread_store_t* store ) in thread_store_get() argument
50 if (!store->has_tls) in thread_store_get()
53 return (void*) TlsGetValue( store->tls ); in thread_store_get()
56 void thread_store_set( thread_store_t* store, in thread_store_set() argument
61 if (!store->lock_init) { in thread_store_set()
62 store->lock_init = -1; in thread_store_set()
63 InitializeCriticalSection( &store->lock ); in thread_store_set()
64 store->lock_init = -2; in thread_store_set()
65 } else while (store->lock_init != -2) { in thread_store_set()
69 EnterCriticalSection( &store->lock ); in thread_store_set()
70 if (!store->has_tls) { in thread_store_set()
71 store->tls = TlsAlloc(); in thread_store_set()
72 if (store->tls == TLS_OUT_OF_INDEXES) { in thread_store_set()
73 LeaveCriticalSection( &store->lock ); in thread_store_set()
76 store->has_tls = 1; in thread_store_set()
78 LeaveCriticalSection( &store->lock ); in thread_store_set()
80 TlsSetValue( store->tls, value ); in thread_store_set()