🖍️
嗡嗡的草稿倉庫
Ctrlk
  • ✏️嗡嗡的草稿倉庫
  • Bash Script
  • Linux
  • C++
    • C++ 一些觀念
    • C++ 條件處理
    • C++ 字串處理
    • C++ 檔案讀取
    • C++ const
    • C++ container
    • C++ struct / class
    • C++ scope
    • C++ function
    • C++ debug
    • C++ multithread / mutex
      • C++ inotify
      • std::condition_variable
      • std::mutex
        • std::lock_guard
        • std::unique_lock
      • multithread issue
      • std::cv_status
    • C++ 記憶體管理 (stack/heap)
    • Modern C++
    • C++ template
    • C++ clang-tidy
    • C++ Learning resource
    • C++ atomic
    • C++ test
    • C++ MISC
    • C++ library
  • Python
  • Machine Learning (ML)
  • Git
  • VSCode
  • Design Pattern
  • Functional programming
  • WordPress
  • 加密貨幣
  • 省思&雜記
  • 嗡嗡的隨手筆記 (整理完放此)
Powered by GitBook
On this page
  1. C++
  2. C++ multithread / mutex
  3. std::mutex

std::lock_guard

scope

{
   std::lock_guard<std::mutex> lock(mutex_var);
} // scope of lock_guard
  • lock_guard unlock

  • https://stackoverflow.com/questions/47704306/is-unlocking-a-lock-guard-manually-undefined-bad-design

  • c++ lock_guard scope

  • https://stackoverflow.com/questions/39330745/scope-of-stdlock-guard-inside-if-block

  • lock_guard

  • https://en.cppreference.com/w/cpp/thread/lock_guard

  • lock_guard unlock mutual

  • https://blog.csdn.net/qq_37233607/article/details/79827466

Previousstd::mutexNextstd::unique_lock

Last updated 2 years ago

Was this helpful?

Was this helpful?