What is the equivalent of Apple Grand Central Dispatch in cocos2d-x/C++? How can i do stuff like
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
…
Thanks!
What is the equivalent of Apple Grand Central Dispatch in cocos2d-x/C++? How can i do stuff like
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
…
Thanks!
Well, if you are utilizing C++11 you can use std::call_once, which uses the same pattern as GCD.
std::once_flag onceToken;
std::call_once (onceToken, …);
thanks a lot!