X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Flock.h;fp=src%2Flock.h;h=5ad56085e997a07e592a177b0b59f24b47074c8c;hp=f46f93d89f7c8da8fba069cb8f4e49058e8e4fef;hb=3a564ed5dbe28c32bc933b318e0170e416b7b779;hpb=1fdb436e78cce2d2128e7ac2117151dab301f4db diff --git a/src/lock.h b/src/lock.h index f46f93d8..5ad56085 100644 --- a/src/lock.h +++ b/src/lock.h @@ -27,12 +27,13 @@ # include typedef pthread_mutex_t Lock; +typedef pthread_cond_t WaitCondition; # define lock_init(x) pthread_mutex_init(x, NULL) # define lock_grab(x) pthread_mutex_lock(x) # define lock_release(x) pthread_mutex_unlock(x) # define lock_destroy(x) pthread_mutex_destroy(x) - +# define cond_destroy(x) pthread_cond_destroy(x); #else @@ -41,11 +42,13 @@ typedef pthread_mutex_t Lock; #undef WIN32_LEAN_AND_MEAN typedef CRITICAL_SECTION Lock; +typedef HANDLE WaitCondition; + # define lock_init(x) InitializeCriticalSection(x) # define lock_grab(x) EnterCriticalSection(x) # define lock_release(x) LeaveCriticalSection(x) # define lock_destroy(x) DeleteCriticalSection(x) - +# define cond_destroy(x) CloseHandle(*x); #endif