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. kERROR_STATE is returned if a finite timeout is specified and the lock is not waitable.

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