13.07.2015 Views

Multithreading - Poco

Multithreading - Poco

Multithreading - Poco

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Scoped Lock> The Scoped Lock is a powerful idiom in C++.> A Scoped Lock acquires a mutex in its constructor, and releasesthe mutex in its destructor.> Thus, a scoped lock at the beginning of a block is the perfect wayto implement a critical section.> At the beginning of the block, in the construction of thescoped lock, the mutex is acquired.> No matter how the block is exited (normally, by return, or byexception), the destructor of the scoped lock ensures therelease of the mutex.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!