From 52331c3bfebd9f8a875f4639a08c3e430ac7f67a Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Wed, 17 Jun 2015 13:54:03 +0000 Subject: [PATCH] AIX port, avoid posix semaphore on AIX due to buggy implementation --- src/common/classes/semaphore.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/common/classes/semaphore.h b/src/common/classes/semaphore.h index 099b9b46e4..04b11f8d27 100644 --- a/src/common/classes/semaphore.h +++ b/src/common/classes/semaphore.h @@ -31,6 +31,10 @@ #include "../jrd/gdsassert.h" +#ifdef _AIX +#undef HAVE_SEMAPHORE_H +#endif + #ifdef WIN_NT // Note: Windows does not need signal safe version of the class @@ -89,7 +93,7 @@ public: #else // WINNT -#ifdef DARWIN +#if defined(DARWIN) // Mach semaphore #define COMMON_CLASSES_SEMAPHORE_MACH @@ -131,9 +135,7 @@ public: } // namespace Firebird -#else // DARWIN - -#ifdef HAVE_SEMAPHORE_H +#elif defined(HAVE_SEMAPHORE_H) #define COMMON_CLASSES_SEMAPHORE_POSIX_RT #include @@ -186,9 +188,11 @@ public: } // namespace Firebird -#endif // HAVE_SEMAPHORE_H +#else // posix OS choice - not found a way to have SignalSafeSemaphore -#endif // DARWIN +#define CLASSES_SEMAPHORE_H_NO_SS_SEM + +#endif // posix OS choice #ifdef CLASSES_SEMAPHORE_H_HAS_TRYENTER @@ -232,6 +236,12 @@ public: void release(SLONG count = 1); }; +#ifdef CLASSES_SEMAPHORE_H_NO_SS_SEM + +typedef Semaphore SignalSafeSemaphore; + +#endif // CLASSES_SEMAPHORE_H_NO_SS_SEM + } // namespace Firebird #endif // CLASSES_SEMAPHORE_H_HAS_TRYENTER