summaryrefslogtreecommitdiff
path: root/lib/command.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-04-28 22:45:59 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-04-30 23:06:14 +0000
commit705f21797e348a02660a638b6d1b2751ef37372e (patch)
tree181a9b3d635fb4df4eb7b2a79542a47213089721 /lib/command.h
parent98f14af8bf8340115049e0df4888b6acc8701ea5 (diff)
lib: allow nonblocking thread_fetch()
This change adds three fields to thread_master and associated code to use them. The fields are: * long selectpoll_timeout This is a millisecond value that, if nonzero, will override the internally calculated timeout for select()/poll(). -1 indicates nonblocking while a positive value indicates the desired timeout in milliseconds. * bool spin This indicates whether a call to thread_fetch() should result in a loop until work is available. By default this is set to true, in order to keep the default behavior. In this case a return value of NULL indicates that a fatal signal was received in select() or poll(). If it is set to false, thread_fetch() will return immediately. NULL is then an acceptable return value if there is no work to be done. * bool handle_signals This indicates whether or not the pthread that owns the thread master is responsible for handling signals (since this is an MT-unsafe operation, it is best to have just the root thread do it). It is set to true by default. Non-root pthreads should set this to false. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.h')
0 files changed, 0 insertions, 0 deletions