misc/165382: [kern] taskqueue_unblock doesn't unblock currently
adrian at FreeBSD.org
Wed Feb 22 02:00:24 UTC 2012
>Synopsis: [kern] taskqueue_unblock doesn't unblock currently queued tasks
>Arrival-Date: Wed Feb 22 02:00:24 UTC 2012
>Originator: Adrian Chadd
This is more a note than a bug.
taskqueue_block() only marks newly queued items as PENDING. If a task is queued to the taskqueue to be run, taskqueue_block() doesn't stop that from occuring.
For example, take a single-thread taskqueue:
* task A is queued - wakeup_one() is called
* task B is queued - wakeup_one() is called
* task A starts to run
* taskqueue_block() is called from another thread
* task C is queued - but instead is marked as PENDING
* task A completes
* task B completes
* task C waits for taskqueue_unblock() to occur.
This means that code which calls taskqueue_block() can't assume that once currently running tasks are completed, nothing further will be done. It can only assume that once currently QUEUED tasks are completed, nothing further will be queued.
These two are subtly different.
More information about the freebsd-bugs