{"type":"rich","description":"gcc\u306e__attribute__((cleanup(fn))) \u304c\u4fbf\u5229\u3059\u304e\u308b\u4ef6\u306b\u3064\u3044\u3066\u3002 C++\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u304d\u306f\u3001RAII\u3068\u304b\u547c\u3070\u308c\u3066\u3044\u308b\u30a4\u30c7\u30a3\u30aa\u30e0\u3092\u4f7f\u3048\u3070\u3001\u3054\u5b58\u3058\u306e\u901a\u308a\u3001\u30ed\u30c3\u30af\u3057\u305fmutex\u3092\u624b\u52d5\u3067\u958b\u653e\u3059\u308b\u5fc5\u8981\u3082\u306a\u3044\u3067\u3059\u3057\u3001new\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u624b\u52d5\u3067delete\u3059\u308b\u5fc5\u8981\u3082\u306a\u3044\u3067\u3059\u3002 void Baz::boo() const { boost::mutex::scoped_lock lock(mutex); // ... return; // lock\u5909\u6570\u306e\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u81ea\u52d5\u958b\u653e\u3002\u624b\u52d5\u3067\u306e\u958b\u653e\u4e0d\u8981 }\u3067\u3082C\u8a00\u8a9e\u3060\u3068\u3001\u5f53\u7136\u306a\u304c\u3089\u624b\u52d5\u3067\u958b\u653e\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002\u8907\u6570\u7b87\u6240\u3067return\u3057\u3066\u3044\u2026","url":"https://yupo5656.hatenadiary.org/entry/20060609/p1","provider_name":"Hatena Blog","height":"190","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/yupo5656/","title":" RAII\u3082\u3069\u304d in C","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyupo5656.hatenadiary.org%2Fentry%2F20060609%2Fp1\" title=\" RAII\u3082\u3069\u304d in C - memologue\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","blog_title":"memologue","published":"2006-06-09 00:00:00","blog_url":"https://yupo5656.hatenadiary.org/","categories":["GCC"],"author_name":"yupo5656","width":"100%"}