X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fplatform.h;h=af7795b9501da1fad19e6dd3a57614fd220394c2;hp=e4b4d2ceaef144b90b2f6a40a159b1b4a7f23f6f;hb=f7096ea7cedeb81d9799e4440a670736825c6a7e;hpb=002062ae934c1fae3e56157e8e7e6451b552ada5 diff --git a/src/platform.h b/src/platform.h index e4b4d2ce..af7795b9 100644 --- a/src/platform.h +++ b/src/platform.h @@ -40,7 +40,6 @@ typedef unsigned __int64 uint64_t; #else # include -# include // Used by sysconf(_SC_NPROCESSORS_ONLN) #endif #ifndef _WIN32 // Linux - Unix @@ -66,7 +65,7 @@ typedef void*(*pt_start_fn)(void*); # define cond_signal(x) pthread_cond_signal(&(x)) # define cond_wait(x,y) pthread_cond_wait(&(x),&(y)) # define cond_timedwait(x,y,z) pthread_cond_timedwait(&(x),&(y),z) -# define thread_create(x,f,t) !pthread_create(&(x),NULL,(pt_start_fn)f,t) +# define thread_create(x,f,t) pthread_create(&(x),NULL,(pt_start_fn)f,t) # define thread_join(x) pthread_join(x, NULL) #else // Windows and MinGW @@ -105,7 +104,7 @@ inline DWORD* dwWin9xKludge() { static DWORD dw; return &dw; } # define cond_signal(x) SetEvent(x) # define cond_wait(x,y) { lock_release(y); WaitForSingleObject(x, INFINITE); lock_grab(y); } # define cond_timedwait(x,y,z) { lock_release(y); WaitForSingleObject(x,z); lock_grab(y); } -# define thread_create(x,f,t) (x = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)f,t,0,dwWin9xKludge()), x != NULL) +# define thread_create(x,f,t) (x = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)f,t,0,dwWin9xKludge())) # define thread_join(x) { WaitForSingleObject(x, INFINITE); CloseHandle(x); } #endif