Posted By

munrobaggers on 06/07/12


Tagged

gcd dispatch


Versions (?)

Use dispatch_once within GCD


 / Published in: Objective C
 

  1. dispatch_queue_t get_my_background_queue()
  2. {
  3. static dispatch_once_t once;
  4. static dispatch_queue_t my_queue;
  5. dispatch_once(&once, ^{
  6. my_queue = dispatch_queue_create("com.example.background", NULL);
  7. });
  8. return my_queue;
  9. }
  10.  

Report this snippet  

You need to login to post a comment.