26POLAR_FUNCTION_INTERNAL intptr_t
29 assert( p_cond != NULL );
31 p_cond->event_condition = CreateEvent(NULL, NO, NO, NULL);
32 if( p_cond->event_condition != (
HANDLE)0 )
39POLAR_FUNCTION_INTERNAL
void
50 assert( p_cond->count_waiters == 0 );
52 if( p_cond->event_condition != (
HANDLE)0 )
56 event_condition = p_cond->event_condition;
57 p_cond->event_condition = (
HANDLE)0;
62 CloseHandle(event_condition);
66POLAR_FUNCTION_INTERNAL intptr_t
70 intptr_t count_waiters;
72 assert( p_cond != NULL );
76 event_condition = p_cond->event_condition;
77 count_waiters = p_cond->count_waiters;
78 p_cond->count_waiters = 0;
82 if( event_condition != (
HANDLE)0 )
84 for( ; count_waiters > 0; count_waiters-- )
87 if( SetEvent(event_condition) )
101POLAR_FUNCTION_INTERNAL intptr_t
106 assert( p_cond != NULL );
110 mtx_lock( &p_cond->lock_condition );
112 if( p_cond->event_condition != (
HANDLE)0 )
114 if( p_cond->count_waiters > 0 )
116 if( SetEvent(p_cond->event_condition) )
118 p_cond->count_waiters--;
132POLAR_FUNCTION_INTERNAL intptr_t
137 assert( p_cond != NULL );
139 mtx_lock( &p_cond->lock_condition );
141 event_condition = p_cond->event_condition;
142 if( event_condition != (
HANDLE)0 )
144 p_cond->count_waiters++;
159POLAR_FUNCTION_INTERNAL intptr_t
164 assert( out_thread_id != NULL );
165 assert( thread_func != NULL );
167 *out_thread_id = (
thrd_t)0;
169 handle_thread_new = CreateThread(NULL, 0, thread_func, thread_data, 0, out_thread_id);
170 if( handle_thread_new != (
HANDLE)0 )
177POLAR_FUNCTION_INTERNAL intptr_t
181 HANDLE handle_thread_target;
185 handle_thread_target = OpenThread(SYNCHRONIZE, NO, id_thread_target);
186 if( handle_thread_target != (
HANDLE)0 )
191 CloseHandle(handle_thread_target);
199POLAR_FUNCTION_INTERNAL intptr_t
204 assert( out_tss_id != NULL );
207 if( tvar_id_new != TLS_OUT_OF_INDEXES )
209 *out_tss_id = tvar_id_new;
220POLAR_FUNCTION_INTERNAL intptr_t
224 POLAR_DEBUG_FUNCTION_END;
230POLAR_FUNCTION_INTERNAL
void
234 POLAR_DEBUG_FUNCTION_END;
DWORD WaitForSingleObject