#include <nng/nng.h> #include <nng/supplemental/util/platform.h> void nng_mtx_lock(nng_mtx *mtx);
|This documentation is for the TIP (development tree) of NNG and may represent unreleased changes or functionality that is experimental, and is subject to change before release. The latest released version is v1.3.2. See the documentation for v1.3.2 for the most up-to-date information.|
nng_mtx_lock - lock mutex
nng_mtx_lock() acquires exclusive ownership of the mutex mtx.
If the lock is already owned, this function will wait until the current
owner releases it with
If multiple threads are waiting for the lock, the order of acquisition is not specified.
|A mutex can only be unlocked by the thread that locked it.|
|Mutex locks are not recursive; attempts to reacquire the same mutex may result in deadlock or aborting the current program. It is a programming error for the owner of a mutex to attempt to reacquire it.|