mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 22:22:45 -04:00
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:
parent
656aa9db5d
commit
0266420798
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue