I'm preparing for the opensource release of the MountainLion libdispatch to the macosforge repository.
As part of that effort I'm planning to merge the Lion branch
http://svn.macosforge.org/repository/libdispatch/branches/Lion
to trunk (replacing the trunk with the branch).
The current trunk (SnowLeopard-era) version of libdispatch is quite old at this point, all new development has been happening on the Lion branch for multiple years, but it is possible that not all contributed portability changes have made it there.
I'm hoping that this merge will clarify the state of ongoing development in the repository, and hopefully prompt contribution of portability fixes for the upcoming MountainLion changes.
Daniel
The GCD reference on developer.apple.com says, regarding dispatch_once_t:
"Variables of this type must have global or static scope. The result of using this type with automatic or dynamic allocation is undefined."
https://developer.apple.com/library/mac/#documentation/Performance/Referenc…
However, I can't find any explanation of why that would be the case, either in the documentation or the libdispatch code. Does anyone have any insight to shed on this? It's occasionally useful to have a dispatch_once_t member variable in an Objective-C object, and it would be nice to know if that's actually OK or not. I have a hard time figuring out how GCD could possibly care about the storage scope of the variable, but it's possible that I'm overlooking something.
Mike