freebsd-skq/share
Will Andrews fdbc71742b 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
..
atf Add ATF to the build. This is may be a bit rought around the egdes, 2012-10-22 01:18:41 +00:00
colldef
dict Disconnect non-MPSAFE NTFS from the build in preparation for dropping 2012-10-17 11:30:00 +00:00
doc Add ATF to the build. This is may be a bit rought around the egdes, 2012-10-22 01:18:41 +00:00
dtrace Remove copy/pasteo in the copyright notice. 2012-07-21 07:14:52 +00:00
examples Retire the mislabeled ENABLE_SUID_SSH knob. 2013-03-22 14:10:15 +00:00
i18n - Fix handling of .mps files 2012-12-17 10:12:12 +00:00
info Install the template info directory with mode 644 instead of 444 to 2013-01-21 22:54:43 +00:00
man Extend taskqueue(9) to enable per-taskqueue callbacks. 2013-03-23 15:11:53 +00:00
me
misc Add FreeBSD 9.1. 2013-03-14 21:20:46 +00:00
mk MFC @248093 2013-03-09 11:57:51 +00:00
mklocale
monetdef Don't link two different things to the same paths. As tiebreaker I've 2013-01-24 17:00:11 +00:00
msgdef Don't link two different things to the same paths. As tiebreaker I've 2013-01-24 17:00:11 +00:00
numericdef Don't link two different things to the same paths. As tiebreaker I've 2013-01-24 17:00:11 +00:00
security
sendmail
skel Remove hack to emulate effective uid and just use the EUID's name in the 2012-12-05 13:56:39 +00:00
snmp
syscons Give credit where credit is due. 2012-12-13 00:44:23 +00:00
tabset
termcap Some software, notably dialog(1), can understand back-tab, which is 2012-11-15 15:05:54 +00:00
timedef
xml Add ATF to the build. This is may be a bit rought around the egdes, 2012-10-22 01:18:41 +00:00
xsl Add ATF to the build. This is may be a bit rought around the egdes, 2012-10-22 01:18:41 +00:00
zoneinfo Use find -exec to install zoneinfo instead of requiring xargs to be an 2013-01-11 18:37:51 +00:00
Makefile Add ATF to the build. This is may be a bit rought around the egdes, 2012-10-22 01:18:41 +00:00
Makefile.inc