Salome HOME
[EDF17470] : huge bug correction.
[modules/kernel.git] / src / SALOMELocalTrace / LocalTraceBufferPool.hxx
index 649acab908b7d3c762b3f3e7339ec542cc09e629..d90d45ee0bc7af34121c13e6331556e9ffc2c115 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -35,6 +35,9 @@
 
 #include <pthread.h>
 #include <semaphore.h>
+#ifdef __APPLE__
+#include <dispatch/dispatch.h>
+#endif
 #include "BaseTraceCollector.hxx"
 #include "BasicsGenericDestructor.hxx"
 
@@ -68,8 +71,13 @@ class SALOMELOCALTRACE_EXPORT LocalTraceBufferPool : public PROTECTED_DELETE
   static BaseTraceCollector *_myThreadTrace;
 
   LocalTrace_TraceInfo _myBuffer[TRACE_BUFFER_SIZE];
+#ifdef __APPLE__
+  dispatch_semaphore_t _freeBufferSemaphore;       // to wait until there is a free buffer
+  dispatch_semaphore_t _fullBufferSemaphore;       // to wait until there is a buffer to print
+#else
   sem_t _freeBufferSemaphore;       // to wait until there is a free buffer
   sem_t _fullBufferSemaphore;       // to wait until there is a buffer to print
+#endif
   pthread_mutex_t _incrementMutex;  // to lock position variables for increment
   unsigned long _position;
   unsigned long _insertPos;