workqueue: separate out drain_workqueue() from destroy_workqueue()
authorTejun Heo <tj@kernel.org>
Tue, 5 Apr 2011 16:01:44 +0000 (18:01 +0200)
committerTejun Heo <tj@kernel.org>
Fri, 20 May 2011 11:54:46 +0000 (13:54 +0200)
There are users which want to drain workqueues without destroying it.
Separate out drain functionality from destroy_workqueue() into
drain_workqueue() and make it accessible to workqueue users.

To guarantee forward-progress, only chain queueing is allowed while
drain is in progress.  If a new work item which isn't chained from the
running or pending work items is queued while draining is in progress,
WARN_ON_ONCE() is triggered.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>

No differences found