¡@

Home 

c++ Programming Glossary: mutex_

Thread pool using boost asio

http://stackoverflow.com/questions/12215395/thread-pool-using-boost-asio

static int count int NoOfThread thread_group grp mutex mutex_ asio io_service io_service int counter stack thread thStk public.. int num NoOfThread num counter 0 mutex scoped_lock lock mutex_ if count 0 count else return for int i 0 i num i thStk.push.. thread_group threads_ std size_t available_ boost mutex mutex_ public @brief Constructor. thread_pool std size_t pool_size..

Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)

http://stackoverflow.com/questions/161177/does-c-support-finally-blocks-and-whats-this-raii-i-keep-hearing-about

which uses 'mutex' and 'lock' objects class foo mutex mutex_ mutex for locking 'foo' object public void bar lock scopeLock.. for locking 'foo' object public void bar lock scopeLock mutex_ lock object. foobar an operation which may throw an exception..

When do programmers use Empty Base Optimization (EBO)

http://stackoverflow.com/questions/4325144/when-do-programmers-use-empty-base-optimization-ebo

the pseudo code class MTSafePolicy public void lock mutex_.lock void unlock mutex_.unlock private Mutex mutex_ class MTUnsafePolicy.. MTSafePolicy public void lock mutex_.lock void unlock mutex_.unlock private Mutex mutex_ class MTUnsafePolicy public void.. lock mutex_.lock void unlock mutex_.unlock private Mutex mutex_ class MTUnsafePolicy public void lock no op void unlock no op..

C++0x has no semaphores? How to synchronize threads?

http://stackoverflow.com/questions/4792449/c0x-has-no-semaphores-how-to-synchronize-threads

boost thread mutex.hpp class semaphore private boost mutex mutex_ boost condition_variable condition_ unsigned long count_ public.. semaphore count_ void notify boost mutex scoped_lock lock mutex_ count_ condition_.notify_one void wait boost mutex scoped_lock.. void wait boost mutex scoped_lock lock mutex_ while count_ condition_.wait lock count_ share improve this..

Throwing exceptions from constructors

http://stackoverflow.com/questions/810839/throwing-exceptions-from-constructors

something like this. class Mutex public Mutex if pthread_mutex_init mutex_ 0 0 throw MutexInitException ~Mutex pthread_mutex_destroy.. like this. class Mutex public Mutex if pthread_mutex_init mutex_ 0 0 throw MutexInitException ~Mutex pthread_mutex_destroy mutex_.. mutex_ 0 0 throw MutexInitException ~Mutex pthread_mutex_destroy mutex_ void lock if pthread_mutex_lock mutex_ 0 throw..