summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2007-03-14 11:50:08 +0000
committerphintuka <phintuka>2007-03-14 11:50:08 +0000
commit46e105a7b03a220fe791e4507f081cc29c375f0f (patch)
treead3d7ae5088ac2343e3fb847bdfb53a3b103cf36
parent60ddf68edb5c637fb5a1546b136fff1a5529c484 (diff)
downloadxineliboutput-46e105a7b03a220fe791e4507f081cc29c375f0f.tar.gz
xineliboutput-46e105a7b03a220fe791e4507f081cc29c375f0f.tar.bz2
Store tid
-rw-r--r--tools/debug_mutex.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/debug_mutex.h b/tools/debug_mutex.h
index 38bb12ce..0802c7cc 100644
--- a/tools/debug_mutex.h
+++ b/tools/debug_mutex.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: debug_mutex.h,v 1.2 2006-12-21 08:07:24 phintuka Exp $
+ * $Id: debug_mutex.h,v 1.3 2007-03-14 11:50:08 phintuka Exp $
*
*/
@@ -39,6 +39,7 @@
static struct {
pthread_mutex_t *lock;
int line;
+ int tid;
} dbgdata[MAX_DBG_MUTEX+1] = {{NULL,0}};
static void dbg_setdata(pthread_mutex_t *mutex, int line)
@@ -47,14 +48,16 @@ static void dbg_setdata(pthread_mutex_t *mutex, int line)
for(i=0; i<MAX_DBG_MUTEX; i++)
if(dbgdata[i].lock == mutex) {
dbgdata[i].line = line;
+ dbgdata[i].tid = syscall(__NR_gettid);
return;
}
- LOGMSG("********** dbg_setdata: new entry (0x%x at %d)", (unsigned long int)mutex, line);
+ LOGMSG("********** dbg_setdata: new entry (0x%lx at %d)", (unsigned long int)mutex, line);
for(i=0; i<MAX_DBG_MUTEX; i++)
if(!dbgdata[i].lock) {
dbgdata[i].lock = mutex;
dbgdata[i].line = line;
+ dbgdata[i].tid = syscall(__NR_gettid);
return;
}
@@ -185,6 +188,9 @@ static int dbg_unlock(pthread_mutex_t *mutex, int line)
LOGERR("********** dbg_unlock: pthread_mutex_unlock FAILED at %d (last locket at %d)",
line, dbg_getdata(mutex, line));
+ //else
+ // dbg_setdata(mutex, 0);
+
return r;
}