Changeset 8 in cheroxy for branches/b0_1_threading/src/CRXMutex.cpp
- Timestamp:
- 10/23/12 13:39:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/b0_1_threading/src/CRXMutex.cpp
r7 r8 12 12 { 13 13 this->Unlock (); 14 this->Destroy (); 14 15 #ifdef _WIN32 15 16 #else … … 17 18 } 18 19 19 int CRXMutex::Create ( )20 int CRXMutex::Create (void) 20 21 { 21 22 #ifdef _WIN32 22 if ((mMutex = ::CreateMutexA(NULL, FALSE, NULL)) == NULL) 23 return -1; 23 if ((mMutex = ::CreateMutexA (NULL, FALSE, NULL)) == NULL) 24 return GetLastError ();; 25 else 26 return 0; 24 27 #else 25 pthread_mutex_init (&mMutex, NULL);28 return pthread_mutex_init (&mMutex, NULL); 26 29 #endif 30 } 27 31 28 return 0; 32 int CRXMutex::Destroy (void) 33 { 34 #ifdef _WIN32 35 if (::CloseHandle (mMutex)) 36 return GetLastError (); 37 else 38 return 0; 39 #else 40 return pthread_mutex_destroy (&mMutex); 41 #endif 29 42 } 30 43
Note:
See TracChangeset
for help on using the changeset viewer.