will 5d3a27c743 Extend taskqueue(9) to enable per-taskqueue callbacks.
The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments.  They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().

This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.

The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9).  This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.

Two callback types are supported at this point:

- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
  to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
  after it has processed its last task but before the taskqueue is
  reclaimed.

While I'm here:

- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
  in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
  interface for all consumers of taskqueue(9).

Reviewed by:	kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	1 month
2013-03-23 15:11:53 +00:00
..
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2010-02-27 01:17:44 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2012-07-01 19:40:51 +00:00
2013-03-04 19:10:39 +00:00
2006-12-14 14:33:13 +00:00
2012-03-26 15:18:14 +00:00
2012-05-20 16:43:47 +00:00
2012-05-12 20:41:40 +00:00
2009-01-03 10:37:38 +00:00
2012-01-19 09:51:07 +00:00
2012-10-30 13:05:50 +00:00
2012-12-07 02:29:32 +00:00
2013-02-28 13:46:03 +00:00
2012-05-12 20:46:19 +00:00
2012-09-04 12:07:33 +00:00
2012-05-20 16:43:47 +00:00
2011-05-25 14:13:53 +00:00
2012-05-20 16:43:47 +00:00
2011-05-25 14:13:53 +00:00
2012-05-20 16:43:47 +00:00
2012-08-30 11:52:26 +00:00
2010-01-15 16:01:22 +00:00
2013-03-04 19:10:39 +00:00
2012-11-16 11:56:53 +00:00
2013-02-13 07:32:09 +00:00
2011-10-21 20:23:40 +00:00
2012-05-20 16:43:47 +00:00
2010-02-06 14:10:45 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2012-01-19 09:51:07 +00:00
2011-10-07 22:14:18 +00:00
2012-06-08 21:30:35 +00:00
2012-07-04 07:42:12 +00:00
2010-07-31 10:01:15 +00:00
2013-03-04 19:10:39 +00:00
2013-03-04 19:10:39 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2013-03-04 19:10:39 +00:00
2012-01-19 09:51:07 +00:00
2012-05-20 16:43:47 +00:00
2006-12-14 14:33:13 +00:00
2012-01-19 09:51:07 +00:00
2013-02-11 10:14:12 +00:00
2013-02-21 22:21:45 +00:00
2010-07-31 10:01:15 +00:00
2008-02-26 20:25:01 +00:00
2012-05-20 16:43:47 +00:00
2012-01-28 23:30:39 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00
2011-11-19 07:52:39 +00:00
2012-10-26 16:40:03 +00:00