From 40bf8fc2d4ec4f46f6454a2600ca849bd09d1772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 15 May 2008 23:25:17 +0000 Subject: [PATCH] a waiting thread can wait on something else than a sem git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25517 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/ps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/ps.c b/src/bin/ps.c index 828d61522c..a15699e73f 100644 --- a/src/bin/ps.c +++ b/src/bin/ps.c @@ -27,7 +27,7 @@ int main(int argc, char **argv) int32 thcookie; sem_info sinfo; char *thstate; - char *states[] = {"run", "rdy", "msg", "zzz", "sus", "sem" }; + char *states[] = {"run", "rdy", "msg", "zzz", "sus", "wait" }; system_info sysinfo; char *string_to_match; // match this in team name @@ -50,12 +50,12 @@ int main(int argc, char **argv) printf("%s (team %ld) (uid %d) (gid %d)\n", teaminfo.args, teaminfo.team, teaminfo.uid, teaminfo.gid); thcookie = 0; while (get_next_thread_info(teaminfo.team, &thcookie, &thinfo) >= B_OK) { - if (thinfo.state < B_THREAD_RUNNING || thinfo.state >B_THREAD_WAITING) + if (thinfo.state < B_THREAD_RUNNING || thinfo.state > B_THREAD_WAITING) thstate = "???"; else thstate = states[thinfo.state-1]; - printf("%7ld %20s %3s %3ld %7lli %7lli ", thinfo.thread, thinfo.name, thstate, thinfo.priority, thinfo.user_time/1000, thinfo.kernel_time/1000); - if (thinfo.state == B_THREAD_WAITING) { + printf("%7ld %20s %4s %3ld %7lli %7lli ", thinfo.thread, thinfo.name, thstate, thinfo.priority, thinfo.user_time/1000, thinfo.kernel_time/1000); + if (thinfo.state == B_THREAD_WAITING && thinfo.sem != -1) { status_t err = get_sem_info(thinfo.sem, &sinfo); if (!err) printf("%s(%ld)\n", sinfo.name, sinfo.sem);