]> git.tuebingen.mpg.de Git - paraslash.git/commit - recv_common.c
task_register() conversion: receivers
authorAndre Noll <maan@systemlinux.org>
Sat, 25 Jan 2014 18:41:45 +0000 (19:41 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 25 May 2014 13:36:37 +0000 (15:36 +0200)
commit8bf35b38357c3ce59f52ae87f6e84e4b6d183ac7
treef1da6580fb5b629334ebbe08e5bbeb592aacdbc4
parenta96be5bc4fda8c0df5370d646defb5ff632ba391
task_register() conversion: receivers

This adds a new public function, task_reap(), to sched.c. It is
called by para_audiod and para_play to free the memory occupied by
the receiver node after EOF. sched_shutdown() can not be used for
this purpose since the scheduler stays active during the life time of
these programs (i.e. schedule() never returns) while receiver nodes
come and go.

The new task_reap() has to face the problem that it is called
from another task's ->post_select() method, so removing the task
being reaped from the scheduler task list is not possible in
task_reap(). Hence this patch adds the new flag "dead" to struct
task. It is initially unset and is turned on in task_reap() to indicate
that (a) the task has exited (i.e. ->post_select() returned negative)
and (b) task_reap() has been called to fetch the exit status. Only
if this flag is set, the scheduler removes the task from the task list.
afh_recv.c
audiod.c
dccp_recv.c
http_recv.c
play.c
recv.c
recv.h
recv_common.c
sched.c
sched.h
udp_recv.c