{"published":"2009-11-21 00:00:19","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhigepon.hatenablog.com%2Fentry%2F20091121%2F1258815619\" title=\" Conditon Variables \u306e\u5185\u90e8\u5b9f\u88c5\u3092\u8003\u3048\u308b - higepon blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://higepon.hatenablog.com/entry/20091121/1258815619","title":" Conditon Variables \u306e\u5185\u90e8\u5b9f\u88c5\u3092\u8003\u3048\u308b","type":"rich","blog_title":"higepon blog","provider_url":"https://hatena.blog","categories":["mona"],"provider_name":"Hatena Blog","height":"190","author_url":"https://blog.hatena.ne.jp/higepon/","blog_url":"https://higepon.hatenablog.com/","description":"wait \u5074\u306e\u30e6\u30fc\u30b6\u30fc\u30b3\u30fc\u30c9 mutex->lock(); while(!some_condition) { condition->wait(mutex); } // \u3053\u3053\u3067\u304a\u4ed5\u4e8b\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066 some_condition \u66f8\u304d\u63db\u3048\u3002 mutex->unlock(); wait \u304c\u5185\u90e8\u3067\u3084\u308b\u4e8b\u306f (1) mutex->unlock (2) \u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30fc\u306e wait queue \u3078\u8ffd\u52a0\uff08\u30d6\u30ed\u30c3\u30af\u3059\u308b\uff09 (3) mutex->lock (1)\u3068(2) \u306f\u30a2\u30c8\u30df\u30c3\u30af\u3002 (2) \u306b\u3088\u308a wait \u306f\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u3002 notifyAll \u5074\u306e\u30e6\u30fc\u30b6\u30fc\u30b3\u30fc\u30c9 mutex->lock(); some_c\u2026","width":"100%","version":"1.0","author_name":"higepon"}