* Replaced the team::dead_children::sem semaphore by a condition

variable. Due to C code including the header I had to turn it from and
  aggregated member to a pointer. I'm very close to starting to convert
  all remaining .c to .cpp files. :-/
* Got rid of the "waiters" field. It was only written, never read.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22084 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-08-27 20:30:34 +00:00
parent 4ed7917682
commit ff895459b7
3 changed files with 72 additions and 57 deletions
+5 -8
View File
@@ -1164,11 +1164,11 @@ thread_exit(void)
if (death != NULL) {
// insert death entry into the parent's list
list_add_link_to_tail(&parent->dead_children.list, death);
if (++parent->dead_children.count > MAX_DEAD_CHILDREN) {
list_add_link_to_tail(&parent->dead_children->list, death);
if (++parent->dead_children->count > MAX_DEAD_CHILDREN) {
death = (struct death_entry*)list_remove_head_item(
&parent->dead_children.list);
parent->dead_children.count--;
&parent->dead_children->list);
parent->dead_children->count--;
} else
death = NULL;
@@ -1176,10 +1176,7 @@ thread_exit(void)
// notify listeners that a new death entry is available
// TODO: should that be moved to handle_signal() (for SIGCHLD)?
release_sem_etc(parent->dead_children.sem,
parent->dead_children.waiters, B_DO_NOT_RESCHEDULE);
parent->dead_children.waiters = 0;
parent->dead_children->condition_variable.NotifyOne();
} else
RELEASE_THREAD_LOCK();