summaryrefslogtreecommitdiff
path: root/lib/command_py.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-05-10 18:09:49 +0000
committerQuentin Young <qlyoung@users.noreply.github.com>2017-05-30 10:27:10 -0400
commit3bf2673b3094727edee168f4b5a93095420f6b23 (patch)
treebd505c40d36993ff6acab398ac3ef36f86cf887f /lib/command_py.c
parent75bcb3558d25b8ca7d3383f5c2c648d0aceae103 (diff)
lib: allow pthreads to poke poll()
When scheduling a task onto a thread master owned by another pthread, we need to lock the thread master's mutex. However, if the pthread which owns that thread master is in poll(), we could be stuck waiting for a very long time. To solve this, we copy all data poll() needs and unlock during poll(). To break the target pthread out of poll(), thread_master has gained a pipe whose reading end is passed into poll(). After an event that requires immediate action by the target pthread, a byte is written into the pipe in order to wake it up. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> [DL: split off from select() removal]
Diffstat (limited to 'lib/command_py.c')
0 files changed, 0 insertions, 0 deletions