![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 #ifndef __SIGNALED_EVENT_H 00002 #define __SIGNALED_EVENT_H 00003 00004 00005 00006 #if defined(_WIN32) 00007 #include <windows.h> 00008 00009 00010 00011 #else 00012 #include <pthread.h> 00013 #include <sys/types.h> 00014 #include "SimpleMutex.h" 00015 00016 00017 00018 00019 #endif 00020 00021 #include "Export.h" 00022 00023 namespace RakNet 00024 { 00025 00026 class RAK_DLL_EXPORT SignaledEvent 00027 { 00028 public: 00029 SignaledEvent(); 00030 ~SignaledEvent(); 00031 00032 void InitEvent(void); 00033 void CloseEvent(void); 00034 void SetEvent(void); 00035 void WaitOnEvent(int timeoutMs); 00036 00037 protected: 00038 #ifdef _WIN32 00039 HANDLE eventList; 00040 00041 00042 00043 00044 #else 00045 SimpleMutex isSignaledMutex; 00046 bool isSignaled; 00047 #if !defined(ANDROID) 00048 pthread_condattr_t condAttr; 00049 #endif 00050 pthread_cond_t eventList; 00051 pthread_mutex_t hMutex; 00052 pthread_mutexattr_t mutexAttr; 00053 #endif 00054 }; 00055 00056 } // namespace RakNet 00057 00058 #endif
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.