Skip to content

Commit

Permalink
Fixing potential concurrency issue with creating the actionQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
blackgold9 committed Oct 10, 2012
1 parent 343b027 commit 52139bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MagicalRecord/Core/MagicalRecord+Actions.m
Expand Up @@ -13,10 +13,11 @@
dispatch_queue_t action_queue(void);
dispatch_queue_t action_queue(void)
{
if (background_action_queue == NULL)
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
background_action_queue = dispatch_queue_create("com.magicalpanda.magicalrecord.actionQueue", DISPATCH_QUEUE_SERIAL);
}
});

return background_action_queue;
}

Expand Down

0 comments on commit 52139bd

Please sign in to comment.