* Added thread block type constant for rw_locks, so that they are listed

correctly by the "thread" and "threads" debugger commands.
* Added "rwlock" debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26703 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-07-31 20:43:40 +00:00
parent 0f9aa9c245
commit 12c9f1761f
3 changed files with 61 additions and 12 deletions
+19 -11
View File
@@ -1050,9 +1050,9 @@ _dump_thread_info(struct thread *thread)
thread->sig_block_mask);
kprintf("in_kernel: %d\n", thread->in_kernel);
kprintf("waiting for: ");
if (thread->state == B_THREAD_WAITING) {
kprintf("waiting for: ");
switch (thread->wait.type) {
case THREAD_BLOCK_TYPE_SEMAPHORE:
{
@@ -1080,6 +1080,10 @@ _dump_thread_info(struct thread *thread)
kprintf("mutex %p\n", thread->wait.object);
break;
case THREAD_BLOCK_TYPE_RW_LOCK:
kprintf("rwlock %p\n", thread->wait.object);
break;
case THREAD_BLOCK_TYPE_OTHER:
kprintf("other (%s)\n", (char*)thread->wait.object);
break;
@@ -1209,7 +1213,7 @@ dump_thread_list(int argc, char **argv)
kprintf("ignoring invalid team argument.\n");
}
kprintf("thread id state wait for object cpu pri stack "
kprintf("thread id state wait for object cpu pri stack "
" team name\n");
hash_open(sThreadHash, &i);
@@ -1233,14 +1237,14 @@ dump_thread_list(int argc, char **argv)
{
sem_id sem = (sem_id)(addr_t)thread->wait.object;
if (sem == thread->msg.read_sem)
kprintf(" ");
kprintf(" ");
else
kprintf("sem %12ld ", sem);
kprintf("sem %12ld ", sem);
break;
}
case THREAD_BLOCK_TYPE_CONDITION_VARIABLE:
kprintf("cvar %p ", thread->wait.object);
kprintf("cvar %p ", thread->wait.object);
break;
case THREAD_BLOCK_TYPE_SNOOZE:
@@ -1248,23 +1252,27 @@ dump_thread_list(int argc, char **argv)
break;
case THREAD_BLOCK_TYPE_SIGNAL:
kprintf("signal ");
kprintf("signal ");
break;
case THREAD_BLOCK_TYPE_MUTEX:
kprintf("mutex %p ", thread->wait.object);
kprintf("mutex %p ", thread->wait.object);
break;
case THREAD_BLOCK_TYPE_RW_LOCK:
kprintf("rwlock %p ", thread->wait.object);
break;
case THREAD_BLOCK_TYPE_OTHER:
kprintf("other ");
kprintf("other ");
break;
default:
kprintf("??? %p ", thread->wait.object);
kprintf("??? %p ", thread->wait.object);
break;
}
} else
kprintf(" - ");
kprintf(" - ");
// on which CPU does it run?
if (thread->cpu)