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
This commit is contained in:
Jérôme Duval
2008-05-15 23:25:17 +00:00
parent 45f03296cf
commit 40bf8fc2d4
+3 -3
View File
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
int32 thcookie; int32 thcookie;
sem_info sinfo; sem_info sinfo;
char *thstate; char *thstate;
char *states[] = {"run", "rdy", "msg", "zzz", "sus", "sem" }; char *states[] = {"run", "rdy", "msg", "zzz", "sus", "wait" };
system_info sysinfo; system_info sysinfo;
char *string_to_match; // match this in team name char *string_to_match; // match this in team name
@@ -54,8 +54,8 @@ int main(int argc, char **argv)
thstate = "???"; thstate = "???";
else else
thstate = states[thinfo.state-1]; 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); 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) { if (thinfo.state == B_THREAD_WAITING && thinfo.sem != -1) {
status_t err = get_sem_info(thinfo.sem, &sinfo); status_t err = get_sem_info(thinfo.sem, &sinfo);
if (!err) if (!err)
printf("%s(%ld)\n", sinfo.name, sinfo.sem); printf("%s(%ld)\n", sinfo.name, sinfo.sem);