added a member in RsThread that indicates the id of the thread currently owning the lock, for debugging purposes

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2132 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-01-26 19:34:31 +00:00
parent 656aa9db5d
commit 0266420798

View File

@ -58,8 +58,8 @@ class RsMutex
#endif #endif
pthread_mutex_lock(&realMutex); pthread_mutex_lock(&realMutex);
#ifdef RSTHREAD_SELF_LOCKING_GUARD
_thread_id = pthread_self() ; _thread_id = pthread_self() ;
#ifdef RSTHREAD_SELF_LOCKING_GUARD
++_cnt ; ++_cnt ;
#endif #endif
} }
@ -69,9 +69,9 @@ class RsMutex
if(--_cnt == 0) if(--_cnt == 0)
{ {
#endif #endif
_thread_id = 0 ;
pthread_mutex_unlock(&realMutex); pthread_mutex_unlock(&realMutex);
#ifdef RSTHREAD_SELF_LOCKING_GUARD #ifdef RSTHREAD_SELF_LOCKING_GUARD
_thread_id = 0 ;
} }
#endif #endif
} }
@ -79,8 +79,8 @@ class RsMutex
private: private:
pthread_mutex_t realMutex; pthread_mutex_t realMutex;
#ifdef RSTHREAD_SELF_LOCKING_GUARD
pthread_t _thread_id ; pthread_t _thread_id ;
#ifdef RSTHREAD_SELF_LOCKING_GUARD
uint32_t _cnt ; uint32_t _cnt ;
#endif #endif
}; };