00001
00002
00003
00004
00005
00006
00007
00008
00014 #ifndef _FU_SEMAPHORE_H_
00015 #define _FU_SEMAPHORE_H_
00016
00017 #ifdef __APPLE__
00018 #include <CoreServices/CoreServices.h>
00019 #endif
00020
00028 class FCOLLADA_EXPORT FUSemaphore
00029 {
00030 private:
00031 #ifdef WIN32
00032 HANDLE semaphoreHandle;
00033 #elif defined (__APPLE__)
00034 MPTaskID semaphoreHandle;
00035 #else
00036 #warning "FUSemaphore: Semaphore not implemented for non Windows"
00037 #endif
00038
00039 public:
00043 FUSemaphore(uint32 initialValue, uint32 maximumValue);
00044
00046 ~FUSemaphore();
00047
00050 void Up();
00051
00059 void Down();
00060 };
00061
00067 class FCOLLADA_EXPORT FUBinarySemaphore : public FUSemaphore
00068 {
00069 public:
00070 FUBinarySemaphore() : FUSemaphore(0, 1) {}
00071 };
00072
00073 #endif // _FU_SEMAPHORE_H_
00074