I donβt know any such object, so I donβt think that you can handle it so easily - and probably it will not be as informative as you think, helping to debug your program. As low-tech as it might seem, enrollment is your friend in debugging these things. Start building your own little sign-up features. They donβt have to be fantasy, they just need to do the work during debugging.
Sorry for C ++, but something like:
void logit(const bool aquired, const char* lockname, const int linenum) { pthread_mutex_lock(&log_mutex); if (! aquired) logfile << pthread_self() << " tries lock " << lockname << " at " << linenum << endl; else logfile << pthread_self() << " has lock " << lockname << " at " << linenum << endl; pthread_mutex_unlock(&log_mutex); } void someTask() { logit(false, "some_mutex", __LINE__); pthread_mutex_lock(&some_mutex); logit(true, "some_mutex", __LINE__);
Journaling is not an ideal solution, but there is nothing. Typically, you get what you need to know.
Duck Aug 14 '10 at 15:31 2010-08-14 15:31
source share