¡@

Home 

c++ Programming Glossary: lock_guard

C++11: std::thread pooled?

http://stackoverflow.com/questions/12993451/c11-stdthread-pooled

n 1024 for int i 0 i n i workers.push_back std thread std lock_guard std mutex lock m thread_ids.insert pthread_self for auto worker..

Does const mean thread-safe in C++11?

http://stackoverflow.com/questions/14127379/does-const-mean-thread-safe-in-c11

int new_height if new_width width new_height height std lock_guard std mutex guard cache_mutex cached_area_valid false width.. width new_width height new_height int area const std lock_guard std mutex guard cache_mutex if cached_area_valid cached_area..

C++11 thread-safe queue

http://stackoverflow.com/questions/15278343/c11-thread-safe-queue

the queue void FileQueue enqueue std string filename std lock_guard std mutex lock qMutex q.push std forward std string filename..

Do I need to synchronize std::condition_variable/condition_variable_any::notify_one

http://stackoverflow.com/questions/15887306/do-i-need-to-synchronize-stdcondition-variable-condition-variable-anynotify

I saw following usage patterns sorry don't remember where lock_guard mutex l m do work c.notify_one But I inspected libstdc sources.. notify_one void condition_variable_any notify_one noexcept lock_guard mutex __lock _M_mutex _M_cond.notify_one And here is layout..

Concurrent programming c++?

http://stackoverflow.com/questions/218786/concurrent-programming-c

etc. lock classes for ease of managing lock lifetime std lock_guard std unique_lock std lock and std try_lock functions to manage..

Using condition variable in a producer-consumer situation

http://stackoverflow.com/questions/2379806/using-condition-variable-in-a-producer-consumer-situation

mutex scoped_lock lock mutexQ messageQ.push s i boost lock_guard lock mutexCond HANGS here bDataReady true condQ.notify_one..

How to use lock_guard when returning protected data

http://stackoverflow.com/questions/3856729/how-to-use-lock-guard-when-returning-protected-data

to use lock_guard when returning protected data I have a question concerning.. data I have a question concerning the use of boost lock_guard or similar scoped locks and using variables that should be protected.. optimization affect this Example Data Class GetData boost lock_guard boost mutex lock this mMutex return this mData Would this be..

Example of how to use boost upgradeable mutexes

http://stackoverflow.com/questions/3896717/example-of-how-to-use-boost-upgradeable-mutexes

this concept. To lock this concept in RAII style use lock_guard or unique_lock for a more complex interface. SharedLockable.. you will do. shared_mutex implements this concept. Use lock_guard or unique_lock to get the exclusive ownership and shared_lock..

Scope with Brackets in C++

http://stackoverflow.com/questions/5072845/scope-with-brackets-in-c

that you want to release as soon as possible e.g. std lock_guard std mutex lock the_mutex use protected objects release the_mutex..

Double-Checked Lock Singleton in C++11

http://stackoverflow.com/questions/6086912/double-checked-lock-singleton-in-c11

instance if m_instance.load std memory_order_relaxed std lock_guard std mutex lock m_mutex if m_instance.load std memory_order_acquire.. instance m_instance.load std memory_order_acquire std lock_guard std mutex lock m_mutex if instance m_instance.load std memory_order_relaxed..

Is there a difference between Boost's scoped mutex and WinAPi's critical section?

http://stackoverflow.com/questions/877577/is-there-a-difference-between-boosts-scoped-mutex-and-winapis-critical-section

boost mutex scoped_lock type and in recent versions boost lock_guard boost mutex and boost unique_lock boost mutex provide RAII wrappers.. a mutex to ensure you don't forget to unlock it. The boost lock_guard and boost unique_lock templates work with any type with lock..

What are the semantics of a const member function?

http://stackoverflow.com/questions/98705/what-are-the-semantics-of-a-const-member-function

mutable boost mutex m public void set_data int i boost lock_guard boost mutex lk m data i int get_data const we want to be able.. want to be able to get the data on a const object boost lock_guard boost mutex lk m this requires m to be non const return data..