mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Fix feature check
Use _POSIX_C_SOURCE to check for PTHREAD_MUTEX_ROBUST support. The latter is a enum, not a defined variable. closes https://github.com/official-stockfish/Stockfish/pull/6510 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
e0fb783c30
commit
1453691496
+2
-2
@@ -502,7 +502,7 @@ class SharedMemory: public detail::SharedMemoryBase {
|
||||
return false;
|
||||
|
||||
bool success = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED) == 0;
|
||||
#ifdef PTHREAD_MUTEX_ROBUST
|
||||
#if _POSIX_C_SOURCE >= 200809L
|
||||
if (success)
|
||||
success = pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST) == 0;
|
||||
#endif
|
||||
@@ -524,7 +524,7 @@ class SharedMemory: public detail::SharedMemoryBase {
|
||||
if (rc == 0)
|
||||
return true;
|
||||
|
||||
#ifdef PTHREAD_MUTEX_ROBUST
|
||||
#if _POSIX_C_SOURCE >= 200809L
|
||||
if (rc == EOWNERDEAD)
|
||||
{
|
||||
if (pthread_mutex_consistent(&header_ptr_->mutex) == 0)
|
||||
|
||||
Reference in New Issue
Block a user