]> git.tuebingen.mpg.de Git - paraslash.git/commit
sched: Introduce task notifications.
authorAndre Noll <maan@systemlinux.org>
Sun, 8 Jul 2012 18:57:16 +0000 (18:57 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Nov 2012 19:28:27 +0000 (20:28 +0100)
commit58ce610c5a46eb03810d8a93b10d5bc51bc10b12
tree5b00482ce1635a99ed6d776cf612dfc0f7cb4d4f
parentb56199aab3056d397697ac0c510d4e973c240d7d
sched: Introduce task notifications.

Currently there is no canonical way to perform inter-task
communications. This leads to ugly hacks like kill_all_decoders()
of audiod which is called when audiod switches to "off" or "standby"
mode. This function sets the error state of the receiver task to a
negative value and removes the receiver's buffer tree node, magically
knowing that this is the correct action to take in order to shut down
the receiver cleanly.

This patch provides a simple infrastructure for task communications
which makes such hacks unnecessary. Tasks may send a notification
value, which is a standard error code, to another task by calling the
new task_notify() function. The receiving task is supposed to check
for any pending notifications in its ->post_select function.

As a first application of the notification concept, the above mentioned
kill_all_decoders() function is changed to use notifications instead.
audiod.c
dccp_recv.c
http_recv.c
sched.c
sched.h
udp_recv.c