10 #include "../fb_private_thread.h"
75 pSignalObjectAndWait = (SIGNALOBJECTANDWAIT)GetProcAddress( GetModuleHandle(
"KERNEL32" ),
"SignalObjectAndWait" );
102 cond = malloc(
sizeof(
FBCOND ) );
147 if( cond && mutex ) {
148 __condops.
wait( cond, mutex );
156 cond->
nt.was_broadcast =
FALSE;
157 cond->
nt.sema = CreateSemaphore(
NULL, 0, 0x7fffffff,
NULL );
163 CloseHandle( cond->
nt.sema );
164 CloseHandle( cond->
nt.waiters_done );
169 ReleaseSemaphore( cond->
nt.sema, 1, 0 );
177 cond->
nt.was_broadcast =
TRUE;
182 WaitForSingleObject( cond->
nt.waiters_done, INFINITE );
183 cond->
nt.was_broadcast =
FALSE;
209 WaitForSingleObject( mutex->id, INFINITE );
246 int result, last_waiter;
253 ReleaseSemaphore( mutex->id, 1,
NULL );
255 result = WaitForMultipleObjects( 2, cond->
w9x.event,
FALSE, INFINITE );
267 WaitForSingleObject( mutex->id, INFINITE );