{"type":"rich","url":"https://haru-s.hatenablog.com/entry/20110415/1302890874","blog_title":"...ing logging 4.0","image_url":null,"provider_name":"Hatena Blog","title":"\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306a\u9280\u884c\u30af\u30e9\u30b9","width":"100%","blog_url":"https://haru-s.hatenablog.com/","author_name":"haru-s","version":"1.0","published":"2011-04-15 03:07:54","categories":["D\u8a00\u8a9e"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fharu-s.hatenablog.com%2Fentry%2F20110415%2F1302890874\" title=\"\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306a\u9280\u884c\u30af\u30e9\u30b9 - ...ing logging 4.0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","author_url":"https://blog.hatena.ne.jp/haru-s/","provider_url":"https://hatena.blog","description":"\u9069\u5207\u306b synchronized \u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u3048\u3070\u5229\u7528\u8005\u5074\u3067\u6c17\u3092\u3064\u3051\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308b\uff0e \u30af\u30e9\u30b9\u30e1\u30f3\u30d0\u306e\u4e2d\u3067\u306e synchronized \u306f synchronized (this) \u3068\u540c\u3058\uff0e import std.stdio; import core.thread; class Bank { private int money_; void payin(int m) { synchronized { money_ += m; } } void payout(int m) { synchronized { // \u304a\u91d1\u304c\u3042\u308b\u3068\u304d\u3060\u3051\u51fa\u91d1\u3059\u308b if (money_ - m > 0) { money_ \u2026"}