Guest User

Untitled

a guest
May 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. +(Server*)sharedInstance{
  2. while (!sharedInstance) {
  3. Server* temp = [[self alloc] init];
  4. if(!temp) break;
  5. if(!OSAtomicCompareAndSwapPtrBarrier(0x00, temp, &sharedInstance)){
  6. [temp release];
  7. }
  8. }
  9. return sharedInstance;
  10. }
Add Comment
Please, Sign In to add comment