Salome HOME
[EDF30062] : Forward of current directory mecanism
[modules/kernel.git] / src / SALOMELocalTrace / LocalTraceBufferPool.hxx
index 649acab908b7d3c762b3f3e7339ec542cc09e629..34d9829e8ef76a727ee79c467a2af6266da658ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include <pthread.h>
 #include <semaphore.h>
+#ifdef __APPLE__
+#include <dispatch/dispatch.h>
+#endif
 #include "BaseTraceCollector.hxx"
 #include "BasicsGenericDestructor.hxx"
 
+#define BRIEF_MESS  2
 #define ABORT_MESS  1   // for traceType field in struct LocalTrace_TraceInfo
 #define NORMAL_MESS 0
 
@@ -68,8 +72,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;