Browse Source

better macros for serial things

August Mueller 10 years ago
parent
commit
44027d234c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/fmdb/FMDatabasePool.m
  2. 1 1
      src/fmdb/FMDatabaseQueue.m

+ 1 - 1
src/fmdb/FMDatabasePool.m

@@ -38,7 +38,7 @@ - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags {
     
     if (self != nil) {
         _path               = [aPath copy];
-        _lockQueue          = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL);
+        _lockQueue          = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], DISPATCH_QUEUE_SERIAL);
         _databaseInPool     = FMDBReturnRetained([NSMutableArray array]);
         _databaseOutPool    = FMDBReturnRetained([NSMutableArray array]);
         _openFlags          = openFlags;

+ 1 - 1
src/fmdb/FMDatabaseQueue.m

@@ -73,7 +73,7 @@ - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags {
         
         _path = FMDBReturnRetained(aPath);
         
-        _queue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL);
+        _queue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], DISPATCH_QUEUE_SERIAL);
         dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
         _openFlags = openFlags;
     }