daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Foo {
  2. public:
  3.     std::chrono::steady_clock::time_point GetVal() {
  4.         std::unique_lock<std::mutex> lock(common_mutex_);
  5.         return val; // Является ли возврат val в этом случае безопасным ???
  6.     };
  7.     void SetVal(std::chrono::steady_clock::time_point new_val) {
  8.         std::unique_lock<std::mutex> lock(common_mutex_);
  9.         val = new_val;
  10.     };
  11. private:
  12.     std::mutex common_mutex_;
  13.     std::chrono::steady_clock::time_point val{0};
  14. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top