kill_thread() and friends are supposed to check the passed in thread_id or else

some signals could go to some group when a negative value was passed in.
This actually fixes bug #702 where SoundPlay obviously does a kill_thread(-1)
at the end (which accidently killed all userspace applications, including the
input_server, app_server, ...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18683 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-29 01:36:54 +00:00
parent 806e2ef627
commit 567f38888f

View File

@ -1514,6 +1514,9 @@ exit_thread(status_t returnValue)
status_t
kill_thread(thread_id id)
{
if (id <= 0)
return B_BAD_VALUE;
return send_signal(id, SIGKILLTHR);
}
@ -1917,6 +1920,9 @@ wait_for_thread(thread_id thread, status_t *_returnCode)
status_t
suspend_thread(thread_id id)
{
if (id <= 0)
return B_BAD_VALUE;
return send_signal(id, SIGSTOP);
}
@ -1924,6 +1930,9 @@ suspend_thread(thread_id id)
status_t
resume_thread(thread_id id)
{
if (id <= 0)
return B_BAD_VALUE;
return send_signal(id, SIGCONT);
}