Contents

commandSleep(void *, UInt32)

Put a thread that is currently holding the command gate to sleep.

Declaration

virtual IOReturn commandSleep(
 void *event, 
 UInt32 interruptible = interruptible);

Parameters

  • event:

    Pointer to an address.

  • interruptible:

    THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE (the default value) specifies that the sleep may be interrupted by any user signal.

Return Value

THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate.

Overview

Put a thread to sleep waiting for an event but release the gate first. If the event occurs then the commandGate is closed before the function returns.

See Also

Miscellaneous