{"image_url":null,"height":"190","version":"1.0","title":"Lock\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068try-with-resources\u306e\u76f8\u6027","width":"100%","blog_url":"https://yohhoy.hatenadiary.jp/","provider_name":"Hatena Blog","published":"2016-11-18 00:00:00","blog_title":"yohhoy\u306e\u65e5\u8a18","author_name":"yohhoy","description":"Java 7\u3067\u5c0e\u5165\u3055\u308c\u305ftry-with-resources\u69cb\u6587\u3068Lock\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u95a2\u4fc2\u306b\u3064\u3044\u3066\u3002Java\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30ed\u30c3\u30af\u51e6\u7406\u3067\u306fAutoCloseable\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u306a\u3044\u305f\u3081\u3001try-with-resources\u69cb\u6587\u3092\u5229\u7528\u3057\u305f\u300c\u5909\u6570\u30b9\u30b3\u30fc\u30d7\u306b\u3082\u3068\u3065\u304f\u30ed\u30c3\u30af\u7372\u5f97\u30fb\u89e3\u653e\u51e6\u7406\uff08Scoped Locking Pattern*1\uff09\u300d\u306f\u30b5\u30dd\u30fc\u30c8\u3057\u306a\u3044\u3002 Lock lk = /*...*/; // \u6b63\u3057\u3044\u5229\u7528\u65b9\u6cd5 lk.lock(); try { // \u30af\u30ea\u30c6\u30a3\u30ab\u30eb\u30bb\u30af\u30b7\u30e7\u30f3 } finally { lk.unlock(); } // Scoped Locking Pattern\uff08\u672a\u2026","author_url":"https://blog.hatena.ne.jp/yohhoy/","type":"rich","url":"https://yohhoy.hatenadiary.jp/entry/20161118/p1","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20161118%2Fp1\" title=\"Lock\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068try-with-resources\u306e\u76f8\u6027 - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["Java"]}