• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/

Lines Matching defs:zthr

27  * to be modeled with a zthr are the following:
37 * 1] Any thread EXCEPT the zthr changes the work indicator from stopped
39 * 2] Only the zthr can change the work indicator from running to stopped
42 * This way a normal zthr cycle should go like this:
45 * running and wakes up the zthr.
46 * 2] The zthr wakes up, checks the indicator and starts working.
47 * 3] When the zthr is done, it changes the indicator to stopped, allowing
50 * Besides being awakened by other threads, a zthr can be configured
59 * Every zthr needs three inputs to start running:
62 * the zthr should start working or go to sleep. The function should
63 * return TRUE when the zthr needs to work or FALSE to let it sleep,
67 * 2] A user-defined ZTHR function (func) which the zthr executes when
77 * the zthr's internal state lock (zthr_state_lock) and the allowed
79 * running checkfunc but not while running func. This way the zthr
82 * To start a zthr:
89 * zthr from another thread using the zthr_pointer.
101 * To cancel a zthr:
107 * A zthr will implicitly check if it has received a cancellation
111 * At times, waiting for the zthr's func to finish its job may take
129 * Cancelling a zthr doesn't clean up its metadata (internal locks,
132 * of the zthr later. Similarly for zthrs that exit themselves.
134 * To completely cleanup a zthr, cancel it first to ensure that it
139 * zthr creation
160 * zthr stopped running
164 * ZTHR wakeup, cancel, and resume are requests on a zthr to
165 * change its internal state. Requests on a zthr are serialized
176 #include <sys/zthr.h>
178 struct zthr {
191 /* flag set to true if we are canceling the zthr */
195 * maximum amount of time that the zthr is spent sleeping;
251 * Create a zthr with specified maximum sleep time. If the time
290 * Wake up the zthr if it is sleeping. If the thread has been
300 * There are 4 states that we can find the zthr when issuing
321 * Sends a cancel request to the zthr and blocks until the zthr is
322 * cancelled. If the zthr is not running (e.g. has been cancelled
346 * control back we expect that the zthr is cancelled and
352 /* broadcast in case the zthr is sleeping */
366 * Sends a resume request to the supplied zthr. If the zthr is
380 * There are 4 states that we find the zthr in at this point
383 * [1] The zthr was cancelled, so we spawn a new thread for
384 * the zthr (common case).
385 * [2] The zthr is running at which point this is a no-op.
386 * [3] The zthr is sleeping at which point this is a no-op.
387 * [4] The zthr was just spawned at which point this is a
400 * This function is intended to be used by the zthr itself