{"author_name":"gfx","height":"190","width":"100%","provider_url":"https://hatena.blog","url":"https://gfx.hatenadiary.org/entry/20120815/1344990198","image_url":null,"title":" Objective-C \u3067singleton pattern","version":"1.0","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgfx.hatenadiary.org%2Fentry%2F20120815%2F1344990198\" title=\" Objective-C \u3067singleton pattern - Islands in the byte stream (legacy)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://gfx.hatenadiary.org/","blog_title":"Islands in the byte stream (legacy)","published":"2012-08-15 09:23:18","categories":[],"description":"Objective-C\u3067\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3067\u3082\u5b89\u5168\u306bsingleton object\u3092\u521d\u671f\u5316\u3059\u308b\u305f\u3081\u306e dispatch_once() \u3068\u3044\u3046\u306e\u304c\u4f7f\u3048\u308b\u3088\u3046\u3060\u3051\u3069\u3001double-checked locking\u306f\u591a\u5c11\u52b9\u679c\u304c\u3042\u308b\u3088\u3046\u3060\u3002\u305f\u3060\u6700\u8fd1\u306e gcc/clang\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 -fthreadsafe-statics \u304c\u6709\u52b9\u306a\u306e\u3067 Objective C++ \u3060\u3068 dispatch_once() \u3059\u3089\u4f7f\u3046\u3053\u3068\u306a\u304f\u5b89\u5168\u306b\u521d\u671f\u5316\u3067\u304d\u308b\u306f\u305a\u3067\u3001\u7121\u7528\u306ahack\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u8981\u691c\u8a3c\u3002 #import <ctime> #import <Foundation/Foundation.h> // simple v\u2026","author_url":"https://blog.hatena.ne.jp/gfx/","provider_name":"Hatena Blog"}