xtd 0.2.0
Loading...
Searching...
No Matches

◆ enter() [1/2]

template<typename object_t >
static void xtd::threading::monitor::enter ( const object_t &  obj)
inlinestatic

Acquires an exclusive lock on the specified obj.

Parameters
objThe object on which to acquire the monitor lock.
Remarks
Use xtd::threading::monotor::enter to acquire the xtd::threading::monotor on the object passed as the parameter. If another thread has executed an xtd::threading::monotor::enter on the object, but has not yet executed the corresponding xtd::threading::monitor::exit, the current thread will block until the other thread releases the object. It is legal for the same thread to invoke xtd::threading::monotor::enter more than once without it blocking; however, an equal number of xtd::threading::monitor::exit calls must be invoked before other threads waiting on the object will unblock.