iOS加锁

#import   
#import   
#import   
#import   
   
#define ITERATIONS (1024*1024*32)  
- (void)testLock  
{  
    double then, now;  
    unsigned int i, count;  
    pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;  
    OSSpinLock spinlock = OS_SPINLOCK_INIT;  
      
    @autoreleasepool {  
        NSLock *lock = [NSLock new];  
        then = CFAbsoluteTimeGetCurrent();  
        for(i=0;i

你可能感兴趣的:(iOS加锁)