* added the inverse [-e] option that waits until all such named threads ended.
I use this to cleanly switch between my dev Tracker and the trunk one. I need to wait until it has really quit before overwriting and running another version. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31852 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+15
-6
@@ -20,14 +20,23 @@
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
status_t ret;
|
status_t ret;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc == 2) {
|
||||||
fprintf(stderr, "Usage: %s thread_name\n", argv[0]);
|
while (find_thread(argv[1]) < 0) {
|
||||||
|
if ((ret = snooze(SNOOZE_TIME)) < B_OK)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else if (argc == 3 && strcmp(argv[1], "-e") == 0) {
|
||||||
|
while (find_thread(argv[2]) >= 0) {
|
||||||
|
if ((ret = snooze(SNOOZE_TIME)) < B_OK)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Usage: %s [-e] thread_name\n"
|
||||||
|
"-e : wait until all threads with that name ended\n", argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
while (find_thread(argv[1]) < 0)
|
|
||||||
if ((ret = snooze(SNOOZE_TIME)) < B_OK)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user