{"id":1123,"date":"2011-01-21T10:13:15","date_gmt":"2011-01-21T09:13:15","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1123"},"modified":"2011-01-21T10:13:15","modified_gmt":"2011-01-21T09:13:15","slug":"csunya-multithreading-hiba","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2011\/01\/21\/csunya-multithreading-hiba\/","title":{"rendered":"Cs\u00fanya multithreading hiba"},"content":{"rendered":"<p><a href=\"http:\/\/geekswithblogs.net\/akraus1\/articles\/90803.aspx\">Double<\/a> <a href=\"http:\/\/www.bluebytesoftware.com\/blog\/PermaLink,guid,543d89ad-8d57-4a51-b7c9-a821e3992bf6.aspx\">checked<\/a> <a href=\"http:\/\/msdn.microsoft.com\/en-us\/magazine\/cc163715.aspx\">lockingnak<\/a> indult, de bug lett bel\u0151le. Mit rontottam el?<\/p>\n<p>private static volatile Dictionary<DateTime, Pair<TimeSpan>> holidayDays;<br \/>\nprivate static readonly object staticLock = new object();<\/p>\n<p>private Dictionary<DateTime, Pair<TimeSpan>> GetHolidayDays()<br \/>\n{<br \/>\n    if (holidayDays == null)<br \/>\n    {<br \/>\n        lock (staticLock)<br \/>\n        {<br \/>\n            if (holidayDays == null)<br \/>\n            {<br \/>\n                holidayDays = new Dictionary<DateTime, Pair<TimeSpan>>();<br \/>\n                FillTradingHours(holidayDays, &#8220;HOL&#8221;);<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n    return holidayDays;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Double checked lockingnak indult, de bug lett bel\u0151le. Mit rontottam el? private static volatile Dictionary holidayDays; private static readonly object staticLock =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,75,10,11,4],"tags":[],"class_list":["post-1123","post","type-post","status-publish","format-standard","hentry","category-net","category-net-4","category-c","category-clr","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1123"}],"version-history":[{"count":2,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1123\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1123\/revisions\/1125"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}