Manual Reference Pages - ZMUTEX (3)
zmutex - working with mutexes (deprecated)
// Create a new mutex container
CZMQ_EXPORT zmutex_t *
// Destroy a mutex container
zmutex_destroy (zmutex_t **self_p);
// Lock mutex
zmutex_lock (zmutex_t *self);
// Unlock mutex
zmutex_unlock (zmutex_t *self);
// Try to lock mutex
zmutex_try_lock (zmutex_t *self);
// Self test of this class
zmutex_test (bool verbose);
The zmutex class provides a portable wrapper for mutexes. Please do not use this class to do multi-threading. It is for the rare case where you absolutely need thread-safe global state. This should happen in system code only. DO NOT USE THIS TO SHARE SOCKETS BETWEEN THREADS, OR DARK THINGS WILL HAPPEN TO YOUR CODE.
Please add @discuss section in ../src/zmutex.c.
From zmutex_test method.
zmutex_t *mutex = zmutex_new ();
The czmq manual was written by the authors in the AUTHORS file.
Main web site: [blue] 
Report bugs to the email <[blue]email@example.com>
Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com Copyright other contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. LICENSE included with the czmq distribution.
|CZMQ 3&.0&.1 ||ZMUTEX (3) ||06/01/2015 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.