> On Oct 19, 2016, at 2:29 PM, Steve Christensen <puns...@mac.com> wrote:
> 
> The only difference between your code and mine is that you haven't 
> initialized onceToken = 0 so it has a random value.
> 
> I looked around to see if that makes a difference and didn't get much 
> confirmation one way or another. One by Mike Ash 
> (https://www.mikeash.com/pyblog/friday-qa-2014-06-06-secrets-of-dispatch_once.html)
>  mentions, "Note that dispatch_once_t is just a typedef for long, initialized 
> to zero, and with the meaning of other values left up to the implementation."

No difference. C static storage with no initializer is always initialized to 
zero.


-- 
Greg Parker     gpar...@apple.com <mailto:gpar...@apple.com>     Runtime 
Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to