Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kLock_EnterEx ( kLock  lock,
k64u  timeout 
)

Blocks until exclusive ownership of the lock is acquired or the timeout interval has elapsed.

kLock ownership is recursive; the same thread can acquire the lock multiple times without blocking. The lock will be relinquished when the number of calls to kLock_Exit balances the number of successful calls to kLockEnter/kLockEnterEx.

kERROR_TIMEOUT is returned if the timeout elapses before the lock can be acquired.

A debug assertion may be raised if a finite timeout is specified and the lock does not support timeouts.

Parameters
lockLock object.
timeoutTimeout in microseconds.
Returns
Operation status.