Nana C++ Library An open-source C++ framework project The Programmer's Guide |
||||||||||||||
nana::threads::recursive_mutex Description The class recursive_mutex provides an exclusive_ownership recursive mutex. Model of None Public base classes None Typedefs
Members
File nana/threads/mutex.hpp Notes 1, An example nana::threads::recursive_mutex mutex; std::size_t n; void inc() { mutex.lock(); ++n; mutex.unlock(); } void thread1() { inc(); } void thread2() { mutex.lock(); for(int i = 0; i < 50; ++i) inc(); mutex.unlock(); } int main() { //start thread1 //start thread2 //wait for threads. } See also None. Move to The Nana Programmer's Guide Main Page |
||||||||||||||