Quickies

[categories] [index] [all (527)] [latest]

Cocoa Foundation
  1. Thread safe code to be run only once with all other thread waiting at the barrier:

    static dispatch_once_t onceToken;
    
    dispatch_once (&onceToken, ^{
        // ...    
    });