I noticed that they don’t return pointers when created, but actual objects. So to get a pointer, I’m trying to declare it like this:
dispatch_queue_t* queue;
*queue = dispatch_queue_create("double_buffer_protection_queue", DISPATCH_QUEUE_SERIAL);
The C++ programmer in me says that should work, but it gives a BAD_ACCESS error, so I’m guessing I’m approaching this the wrong way.
If I want a serial queue that can be accessed by any object in my program, how do I do it? The code I showed above was meant to go in the AppDelegate class.
In Grand Central Dispatch, using actual objects is proper way. For instance,
And then the another owner of the queue must retain and release it by itself like Objective-C objects.