<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2015-02-20-lets-build-synchronized.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Thu, 12 Nov 2026 22:47:53 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Retail Deliveries Red Deer - 2022-03-15 20:32:39</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>The website content is remarkable and very informative. Keep up the good work! 
&lt;br /&gt;
&lt;br /&gt;</description><guid isPermaLink="true">fa37188e0e854124928ff2471586d960</guid><pubDate>Tue, 15 Mar 2022 20:32:39 GMT</pubDate></item><item><title>Masonry - 2021-05-11 11:51:28</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>Please continue to inspire your readers. Good work!
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&amp;nbsp;</description><guid isPermaLink="true">97de51edb3bb306ec0666cf2d78f666d</guid><pubDate>Tue, 11 May 2021 11:51:28 GMT</pubDate></item><item><title>Plumbers Airdrie - 2021-04-15 20:45:38</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>Your site has a lot of useful information for me, I visit it very often. Keep it up!
&lt;br /&gt;
&lt;br /&gt;&amp;nbsp;
&lt;br /&gt;</description><guid isPermaLink="true">30ebed622b8b677db9363200f02e6b3f</guid><pubDate>Thu, 15 Apr 2021 20:45:38 GMT</pubDate></item><item><title>David Nedrow - 2015-03-17 20:36:19</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>In the first code example...
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;NSMutableArray *array;
&lt;br /&gt;NSLock *arrayLock;
&lt;br /&gt;
&lt;br /&gt;[lock lock];
&lt;br /&gt;[array addObject: obj];
&lt;br /&gt;[lock unlock];
&lt;br /&gt;&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;...shouldn't it be [&lt;b&gt;arrayLock&lt;/b&gt; lock] and [&lt;b&gt;arrayLock&lt;/b&gt; unlock]?</description><guid isPermaLink="true">c55ef9f1a1a7a0d64e3feb745eae953a</guid><pubDate>Tue, 17 Mar 2015 20:36:19 GMT</pubDate></item><item><title>Taylor - 2015-03-11 23:34:20</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>Well, seems it's the time to pick up Swift for further projects. It would be funny to see how fast the Apple's implementation it is.</description><guid isPermaLink="true">1f9c5502bf4725c73be78b702013261f</guid><pubDate>Wed, 11 Mar 2015 23:34:20 GMT</pubDate></item><item><title>Charles Parnot - 2015-02-24 23:11:16</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>Small typo in the first block of code: you define an &lt;i&gt;arrayLock&lt;/i&gt; but then you use a &lt;i&gt;lock&lt;/i&gt; variable in the rest of the code.</description><guid isPermaLink="true">e0ec1abc3b3de7fcaa74f3b768e71737</guid><pubDate>Tue, 24 Feb 2015 23:11:16 GMT</pubDate></item><item><title>Jordan - 2015-02-24 03:47:12</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>@Jack: That means something slightly different. The way Mike wrote it asserts that no non-NSRecursiveLocks have snuck into the dictionary; using "as?" would silently let them pass. Both do handle &lt;code&gt;nil&lt;/code&gt; the same, though.</description><guid isPermaLink="true">359a39c6ce77785c0e92246747efd49f</guid><pubDate>Tue, 24 Feb 2015 03:47:12 GMT</pubDate></item><item><title>Jack - 2015-02-23 05:41:52</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>Great article. Very small nitpick:
&lt;br /&gt;&lt;code&gt;var lock = locksTable.objectForKey(obj) as! NSRecursiveLock?&lt;/code&gt;
&lt;br /&gt;Can be written slightly more simply as:
&lt;br /&gt;&lt;code&gt;var lock = locksTable.objectForKey(obj) as? NSRecursiveLock&lt;/code&gt;</description><guid isPermaLink="true">635329ed48fa43552eb0d6056c15a118</guid><pubDate>Mon, 23 Feb 2015 05:41:52 GMT</pubDate></item><item><title>Jean-Daniel - 2015-02-21 13:56:31</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2015-02-20-lets-build-synchronized.html#comments</link><description>One of the main difference between @synchronized and raw lock is that the former is exception safe. That is the lock will be release on throw. That is not much a difference for swift as exceptions are not supported, but I think it is worth mentioning if you try to rebuild it ;-)</description><guid isPermaLink="true">edef46e82e8ebe5bf1e276def50c9a5f</guid><pubDate>Sat, 21 Feb 2015 13:56:31 GMT</pubDate></item></channel></rss>
