Lines Matching +full:reset +full:- +full:on +full:- +full:timeout
5 This page documents the user-space API for the ntsync driver.
8 primitives by user-space NT emulators. It exists because implementation
9 in user-space, using existing tools, cannot match Windows performance
23 A semaphore holds a single volatile 32-bit counter, and a static 32-bit
30 A mutex holds a volatile 32-bit recursion count, and a volatile 32-bit
38 tracked automatically based on thread death, but rather must be
50 are two types of events, auto-reset and manual-reset. An auto-reset
51 event is designaled when a wait is satisfied; a manual-reset event is
54 Unless specified otherwise, all operations on an object are atomic and
55 totally ordered with respect to other operations on the same object.
64 description opened on the device represents a unique instance intended
72 All operations on the device are done through ioctls. There are four
91 __u64 timeout;
101 Depending on the ioctl, members of the structure may be used as input,
104 The ioctls on the device file are as follows:
111 .. list-table::
113 * - ``count``
114 - Initial count of the semaphore.
115 * - ``max``
116 - Maximum count of the semaphore.
119 On success, returns a file descriptor the created semaphore.
126 .. list-table::
128 * - ``count``
129 - Initial recursion count of the mutex.
130 * - ``owner``
131 - Initial owner of the mutex.
135 On success, returns a file descriptor the created mutex.
142 .. list-table::
144 * - ``signaled``
145 - If nonzero, the event is initially signaled, otherwise
147 * - ``manual``
148 - If nonzero, the event is a manual-reset event, otherwise
149 auto-reset.
151 On success, returns a file descriptor the created event.
153 The ioctls on the individual objects are as follows:
157 Post to a semaphore object. Takes a pointer to a 32-bit integer,
158 which on input holds the count to be added to the semaphore, and on
165 waiting on this semaphore will be woken and the semaphore's count
173 .. list-table::
175 * - ``owner``
176 - Specifies the owner trying to release this mutex.
177 * - ``count``
178 - On output, contains the previous recursion count.
186 unowned and signaled, and eligible threads waiting on it will be
191 Signal an event object. Takes a pointer to a 32-bit integer, which on
194 Eligible threads will be woken, and auto-reset events will be
199 Designal an event object. Takes a pointer to a 32-bit integer, which
200 on output contains the previous state of the event.
204 Wake threads waiting on an event object while leaving it in an
205 unsignaled state. Takes a pointer to a 32-bit integer, which on
208 A pulse operation can be thought of as a set followed by a reset,
209 performed as a single atomic operation. If two threads are waiting on
210 an auto-reset event which is pulsed, only one will be woken. If two
211 threads are waiting a manual-reset event which is pulsed, both will
221 .. list-table::
223 * - ``count``
224 - On output, contains the current count of the semaphore.
225 * - ``max``
226 - On output, contains the maximum count of the semaphore.
233 .. list-table::
235 * - ``owner``
236 - On output, contains the current owner of the mutex, or zero
238 * - ``count``
239 - On output, contains the current recursion count of the mutex.
250 .. list-table::
252 * - ``signaled``
253 - On output, contains the current state of the event.
254 * - ``manual``
255 - On output, contains 1 if the event is a manual-reset event,
261 owner. Takes an input-only pointer to a 32-bit integer denoting the
265 Eligible threads waiting on the mutex will be woken as appropriate
270 Poll on any of a list of objects, atomically acquiring at most one.
274 .. list-table::
276 * - ``timeout``
277 - Absolute timeout in nanoseconds. If ``NTSYNC_WAIT_REALTIME``
278 is set, the timeout is measured against the REALTIME clock;
280 timeout is equal to or earlier than the current time, the
281 function returns immediately without sleeping. If ``timeout``
284 * - ``objs``
285 - Pointer to an array of ``count`` file descriptors
289 * - ``count``
290 - Number of objects specified in the ``objs`` array.
293 * - ``owner``
294 - Mutex owner identifier. If any object in ``objs`` is a mutex,
295 the ioctl will attempt to acquire that mutex on behalf of
298 * - ``index``
299 - On success, contains the index (into ``objs``) of the object
302 * - ``alert``
303 - Optional event object file descriptor. If nonzero, this
307 * - ``flags``
308 - Zero or more flags. Currently the only flag is
309 ``NTSYNC_WAIT_REALTIME``, which causes the timeout to be
311 * - ``pad``
312 - Unused, must be set to zero.
316 acquiring it, or the timeout expires. In the latter case the ioctl
324 and setting its owner to the ``owner`` argument. An auto-reset event
325 is acquired by designaling it; a manual-reset event is not affected
329 operations on the same object. If two wait operations (with different
330 ``owner`` identifiers) are queued on the same mutex, only one is
331 signaled. If two wait operations are queued on the same semaphore,
352 Poll on a list of objects, atomically acquiring all of them. Takes a
355 always filled with zero on success if not woken via alert.
359 simultaneously signaled, subsequently acquiring them, or the timeout
367 with respect to other operations on any of the given objects.