00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _MXSEMAPHORE_H_X_X
00020 #define _MXSEMAPHORE_H_X_X
00021
00022 #include "SDL.h"
00023
00024
00025 namespace mx
00026 {
00027
00028
00029
00031 class mxSem {
00032
00033 public:
00035 explicit mxSem(unsigned int value);
00037 ~mxSem();
00039 const unsigned int currentValue() const;
00041 int wait();
00043 int tryWait();
00045 int waitTimeout(unsigned int interval);
00047 int post();
00048 private:
00049 SDL_sem *sem;
00050 };
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 }
00066
00067
00068 #endif
00069
00070