diff --git a/libretroshare/src/util/rsthreads.h b/libretroshare/src/util/rsthreads.h index ba6e476c1..7e06e05b4 100644 --- a/libretroshare/src/util/rsthreads.h +++ b/libretroshare/src/util/rsthreads.h @@ -46,9 +46,7 @@ class RsMutex { pthread_mutex_init(&realMutex, NULL); #ifdef RSTHREAD_SELF_LOCKING_GUARD - //_thread_id = {NULL, 0} ; // need c++ - _thread_id.p = NULL; - _thread_id.x = 0; + _thread_id = 0 ; #endif } ~RsMutex() @@ -64,8 +62,8 @@ class RsMutex #endif pthread_mutex_lock(&realMutex); -#ifdef RSTHREAD_SELF_LOCKING_GUARD _thread_id = pthread_self() ; +#ifdef RSTHREAD_SELF_LOCKING_GUARD ++_cnt ; #endif } @@ -74,11 +72,11 @@ class RsMutex #ifdef RSTHREAD_SELF_LOCKING_GUARD if(--_cnt == 0) { - //_thread_id = {NULL, 0} ; // need c++ - _thread_id.p = NULL; - _thread_id.x = 0; #endif - pthread_mutex_unlock(&realMutex); +#ifndef WIN32 + _thread_id = 0 ; +#endif + pthread_mutex_unlock(&realMutex); #ifdef RSTHREAD_SELF_LOCKING_GUARD } #endif @@ -87,8 +85,8 @@ class RsMutex private: pthread_mutex_t realMutex; -#ifdef RSTHREAD_SELF_LOCKING_GUARD pthread_t _thread_id ; +#ifdef RSTHREAD_SELF_LOCKING_GUARD uint32_t _cnt ; #endif };