send_signal_etc() is now safe to be used on an SMP machine.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14523 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-10-25 20:18:29 +00:00
parent 9aeec96cbd
commit 3207006695
2 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -256,8 +256,8 @@ notify_loading_app(status_t result, bool suspend)
loadingInfo->done = true;
// we're done with the team stuff, get the thread lock instead
GRAB_THREAD_LOCK();
RELEASE_TEAM_LOCK();
GRAB_THREAD_LOCK();
// wake up the waiting thread
if (loadingInfo->thread->state == B_THREAD_SUSPENDED) {
+1 -5
View File
@@ -318,12 +318,9 @@ send_signal_etc(pid_t id, uint signal, uint32 flags)
group = team->group;
for (team = group->teams; team != NULL; team = next) {
// ToDo: there is a *big* race condition here on SMP machines;
// the team pointer will probably have gone bad in the mean time
next = team->group_next;
id = team->main_thread->id;
RELEASE_TEAM_LOCK();
GRAB_THREAD_LOCK();
thread = thread_get_thread_struct_locked(id);
@@ -334,7 +331,6 @@ send_signal_etc(pid_t id, uint signal, uint32 flags)
}
RELEASE_THREAD_LOCK();
GRAB_TEAM_LOCK();
}
RELEASE_TEAM_LOCK();
@@ -342,7 +338,7 @@ send_signal_etc(pid_t id, uint signal, uint32 flags)
}
}
// ToDo: maybe the scheduler should only be invoked is there is reason to do it?
// ToDo: maybe the scheduler should only be invoked if there is reason to do it?
// (ie. deliver_signal() moved some threads in the running queue?)
if ((flags & B_DO_NOT_RESCHEDULE) == 0)
scheduler_reschedule();