├── .gitignore ├── MultiThreading.xcodeproj ├── xcuserdata │ └── gfx.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── MultiThreading.xcscheme └── project.pbxproj ├── MultiThreadingTests ├── Info.plist └── MultiThreadingTests.swift ├── README.md └── MultiThreading ├── Images.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── Main.storyboard └── LaunchScreen.xib ├── Info.plist ├── AppDelegate.swift └── ViewController.swift /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | xcuserdata/ 4 | -------------------------------------------------------------------------------- /MultiThreading.xcodeproj/xcuserdata/gfx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MultiThreading.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FABC39491AB651F100C7765D 16 | 17 | primary 18 | 19 | 20 | FABC395E1AB651F100C7765D 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MultiThreadingTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Synchronization in Swift 2 | 3 | Swift has no synchornozation functionality in the language, 4 | but Foundation framework is available to synchronize the code. 5 | 6 | ## Use of `dispatch_sync()` 7 | 8 | ```swift 9 | class Foo { 10 | var value = 0 11 | let sync = dispatch_queue_create("\(self.dynamicType).sync", DISPATCH_QUEUE_SERIAL) 12 | 13 | func incrementWithSerialQueue() { 14 | dispatch_sync(sync) { 15 | self.value += 1 16 | } 17 | } 18 | 19 | ``` 20 | 21 | ## Use of `objc_sync_enter()` and `objc_sync_exit()` 22 | 23 | ```swift 24 | class AutoSync { 25 | let object : AnyObject 26 | 27 | init(_ obj : AnyObject) { 28 | object = obj 29 | objc_sync_enter(object) 30 | } 31 | 32 | deinit { 33 | objc_sync_exit(object) 34 | } 35 | } 36 | 37 | class Foo { 38 | var value = 0 39 | 40 | func incrementWithObjcSync() { 41 | let lock = AutoSync(self) 42 | self.value += 1 43 | } 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /MultiThreadingTests/MultiThreadingTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiThreadingTests.swift 3 | // MultiThreadingTests 4 | // 5 | // Created by Fuji Goro on 2015/03/16. 6 | // Copyright (c) 2015年 FUJI Goro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class MultiThreadingTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /MultiThreading/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /MultiThreading/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /MultiThreading/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /MultiThreading/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MultiThreading 4 | // 5 | // Created by Fuji Goro on 2015/03/16. 6 | // Copyright (c) 2015年 FUJI Goro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /MultiThreading/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MultiThreading/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // MultiThreading 4 | // 5 | // Created by Fuji Goro on 2014/07/23. 6 | // Copyright (c) 2014年 FUJI Goro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | let N = 100_000 13 | 14 | var c1 = dispatch_queue_create("concurrent.1", DISPATCH_QUEUE_CONCURRENT) 15 | var c2 = dispatch_queue_create("concurrent.2", DISPATCH_QUEUE_CONCURRENT) 16 | 17 | let sync = dispatch_queue_create("\(self.dynamicType).sync", DISPATCH_QUEUE_SERIAL) 18 | 19 | var value : Int = 0; 20 | 21 | var t0 = NSDate().timeIntervalSince1970 22 | 23 | override func viewWillAppear(animated: Bool) { 24 | super.viewWillAppear(animated) 25 | 26 | 27 | let interval = dispatch_time(DISPATCH_TIME_NOW, Int64(2 * NSEC_PER_SEC)) 28 | dispatch_after(interval, dispatch_get_main_queue()) { 29 | self.useObjcSync() 30 | } 31 | } 32 | 33 | func useObjcSync() { 34 | NSLog("start with objc_sync_enter") 35 | 36 | t0 = NSDate().timeIntervalSince1970 37 | 38 | dispatch_async(c1) { 39 | for _ in 0 ..< self.N { 40 | self.incrementWithObjcSync() 41 | } 42 | 43 | self.next() 44 | } 45 | 46 | dispatch_async(c2) { 47 | for _ in 0 ..< self.N { 48 | self.incrementWithObjcSync() 49 | } 50 | 51 | self.next() 52 | } 53 | } 54 | 55 | func useSerialQueue() { 56 | NSLog("start with serial queue") 57 | t0 = NSDate().timeIntervalSince1970 58 | 59 | dispatch_async(c1) { 60 | for _ in 0 ..< self.N { 61 | self.incrementWithSerialQueue() 62 | } 63 | 64 | self.finished() 65 | } 66 | 67 | dispatch_async(c2) { 68 | for _ in 0 ..< self.N { 69 | self.incrementWithSerialQueue() 70 | } 71 | 72 | self.finished() 73 | } 74 | } 75 | 76 | class AutoSync { 77 | let object : AnyObject 78 | 79 | init(_ obj : AnyObject) { 80 | object = obj 81 | objc_sync_enter(object) 82 | } 83 | 84 | deinit { 85 | objc_sync_exit(object) 86 | } 87 | } 88 | 89 | func incrementWithObjcSync() { 90 | // XXX: do not rename "lock" to "_", which seems to make it no-op 91 | let lock = AutoSync(self) 92 | self.value += 1 93 | } 94 | 95 | func incrementWithSerialQueue() { 96 | dispatch_sync(sync) { 97 | self.value += 1 98 | } 99 | } 100 | 101 | func next() { 102 | struct _Next { 103 | static var count = 0 104 | } 105 | 106 | if ++_Next.count >= 2 { 107 | NSLog("elapsed: %.03f sec.", NSDate().timeIntervalSince1970 - t0) 108 | useSerialQueue() 109 | } 110 | } 111 | 112 | func finished() { 113 | struct _Finished { 114 | static var count = 0 115 | } 116 | 117 | if ++_Finished.count >= 2 { 118 | NSLog("elapsed: %.03f sec.", NSDate().timeIntervalSince1970 - t0) 119 | 120 | let interval = dispatch_time(DISPATCH_TIME_NOW, Int64(1 * NSEC_PER_SEC)) 121 | dispatch_after(interval, dispatch_get_main_queue()) { 122 | self.show(String(format: "value = %d", self.value)) 123 | } 124 | } 125 | } 126 | 127 | func show(message : String) { 128 | NSLog("finished %@", message); 129 | let alert = UIAlertView(title: "Finished", message: message, delegate: nil, cancelButtonTitle: "OK") 130 | alert.show() 131 | } 132 | } 133 | 134 | -------------------------------------------------------------------------------- /MultiThreading.xcodeproj/xcuserdata/gfx.xcuserdatad/xcschemes/MultiThreading.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /MultiThreading.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FABC39501AB651F100C7765D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FABC394F1AB651F100C7765D /* AppDelegate.swift */; }; 11 | FABC39521AB651F100C7765D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FABC39511AB651F100C7765D /* ViewController.swift */; }; 12 | FABC39551AB651F100C7765D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FABC39531AB651F100C7765D /* Main.storyboard */; }; 13 | FABC39571AB651F100C7765D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FABC39561AB651F100C7765D /* Images.xcassets */; }; 14 | FABC395A1AB651F100C7765D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = FABC39581AB651F100C7765D /* LaunchScreen.xib */; }; 15 | FABC39661AB651F100C7765D /* MultiThreadingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FABC39651AB651F100C7765D /* MultiThreadingTests.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | FABC39601AB651F100C7765D /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = FABC39421AB651F100C7765D /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = FABC39491AB651F100C7765D; 24 | remoteInfo = MultiThreading; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | FABC394A1AB651F100C7765D /* MultiThreading.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiThreading.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | FABC394E1AB651F100C7765D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | FABC394F1AB651F100C7765D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 32 | FABC39511AB651F100C7765D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 33 | FABC39541AB651F100C7765D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | FABC39561AB651F100C7765D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | FABC39591AB651F100C7765D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 36 | FABC395F1AB651F100C7765D /* MultiThreadingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MultiThreadingTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | FABC39641AB651F100C7765D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | FABC39651AB651F100C7765D /* MultiThreadingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiThreadingTests.swift; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | FABC39471AB651F100C7765D /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | FABC395C1AB651F100C7765D /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | FABC39411AB651F100C7765D = { 60 | isa = PBXGroup; 61 | children = ( 62 | FABC394C1AB651F100C7765D /* MultiThreading */, 63 | FABC39621AB651F100C7765D /* MultiThreadingTests */, 64 | FABC394B1AB651F100C7765D /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | FABC394B1AB651F100C7765D /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | FABC394A1AB651F100C7765D /* MultiThreading.app */, 72 | FABC395F1AB651F100C7765D /* MultiThreadingTests.xctest */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | FABC394C1AB651F100C7765D /* MultiThreading */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | FABC394F1AB651F100C7765D /* AppDelegate.swift */, 81 | FABC39511AB651F100C7765D /* ViewController.swift */, 82 | FABC39531AB651F100C7765D /* Main.storyboard */, 83 | FABC39561AB651F100C7765D /* Images.xcassets */, 84 | FABC39581AB651F100C7765D /* LaunchScreen.xib */, 85 | FABC394D1AB651F100C7765D /* Supporting Files */, 86 | ); 87 | path = MultiThreading; 88 | sourceTree = ""; 89 | }; 90 | FABC394D1AB651F100C7765D /* Supporting Files */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | FABC394E1AB651F100C7765D /* Info.plist */, 94 | ); 95 | name = "Supporting Files"; 96 | sourceTree = ""; 97 | }; 98 | FABC39621AB651F100C7765D /* MultiThreadingTests */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | FABC39651AB651F100C7765D /* MultiThreadingTests.swift */, 102 | FABC39631AB651F100C7765D /* Supporting Files */, 103 | ); 104 | path = MultiThreadingTests; 105 | sourceTree = ""; 106 | }; 107 | FABC39631AB651F100C7765D /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | FABC39641AB651F100C7765D /* Info.plist */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | FABC39491AB651F100C7765D /* MultiThreading */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = FABC39691AB651F100C7765D /* Build configuration list for PBXNativeTarget "MultiThreading" */; 121 | buildPhases = ( 122 | FABC39461AB651F100C7765D /* Sources */, 123 | FABC39471AB651F100C7765D /* Frameworks */, 124 | FABC39481AB651F100C7765D /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = MultiThreading; 131 | productName = MultiThreading; 132 | productReference = FABC394A1AB651F100C7765D /* MultiThreading.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | FABC395E1AB651F100C7765D /* MultiThreadingTests */ = { 136 | isa = PBXNativeTarget; 137 | buildConfigurationList = FABC396C1AB651F100C7765D /* Build configuration list for PBXNativeTarget "MultiThreadingTests" */; 138 | buildPhases = ( 139 | FABC395B1AB651F100C7765D /* Sources */, 140 | FABC395C1AB651F100C7765D /* Frameworks */, 141 | FABC395D1AB651F100C7765D /* Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | FABC39611AB651F100C7765D /* PBXTargetDependency */, 147 | ); 148 | name = MultiThreadingTests; 149 | productName = MultiThreadingTests; 150 | productReference = FABC395F1AB651F100C7765D /* MultiThreadingTests.xctest */; 151 | productType = "com.apple.product-type.bundle.unit-test"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | FABC39421AB651F100C7765D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastSwiftUpdateCheck = 0710; 160 | LastUpgradeCheck = 0710; 161 | ORGANIZATIONNAME = "FUJI Goro"; 162 | TargetAttributes = { 163 | FABC39491AB651F100C7765D = { 164 | CreatedOnToolsVersion = 6.3; 165 | }; 166 | FABC395E1AB651F100C7765D = { 167 | CreatedOnToolsVersion = 6.3; 168 | TestTargetID = FABC39491AB651F100C7765D; 169 | }; 170 | }; 171 | }; 172 | buildConfigurationList = FABC39451AB651F100C7765D /* Build configuration list for PBXProject "MultiThreading" */; 173 | compatibilityVersion = "Xcode 3.2"; 174 | developmentRegion = English; 175 | hasScannedForEncodings = 0; 176 | knownRegions = ( 177 | en, 178 | Base, 179 | ); 180 | mainGroup = FABC39411AB651F100C7765D; 181 | productRefGroup = FABC394B1AB651F100C7765D /* Products */; 182 | projectDirPath = ""; 183 | projectRoot = ""; 184 | targets = ( 185 | FABC39491AB651F100C7765D /* MultiThreading */, 186 | FABC395E1AB651F100C7765D /* MultiThreadingTests */, 187 | ); 188 | }; 189 | /* End PBXProject section */ 190 | 191 | /* Begin PBXResourcesBuildPhase section */ 192 | FABC39481AB651F100C7765D /* Resources */ = { 193 | isa = PBXResourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | FABC39551AB651F100C7765D /* Main.storyboard in Resources */, 197 | FABC395A1AB651F100C7765D /* LaunchScreen.xib in Resources */, 198 | FABC39571AB651F100C7765D /* Images.xcassets in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | FABC395D1AB651F100C7765D /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | /* End PBXResourcesBuildPhase section */ 210 | 211 | /* Begin PBXSourcesBuildPhase section */ 212 | FABC39461AB651F100C7765D /* Sources */ = { 213 | isa = PBXSourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | FABC39521AB651F100C7765D /* ViewController.swift in Sources */, 217 | FABC39501AB651F100C7765D /* AppDelegate.swift in Sources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | FABC395B1AB651F100C7765D /* Sources */ = { 222 | isa = PBXSourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | FABC39661AB651F100C7765D /* MultiThreadingTests.swift in Sources */, 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXSourcesBuildPhase section */ 230 | 231 | /* Begin PBXTargetDependency section */ 232 | FABC39611AB651F100C7765D /* PBXTargetDependency */ = { 233 | isa = PBXTargetDependency; 234 | target = FABC39491AB651F100C7765D /* MultiThreading */; 235 | targetProxy = FABC39601AB651F100C7765D /* PBXContainerItemProxy */; 236 | }; 237 | /* End PBXTargetDependency section */ 238 | 239 | /* Begin PBXVariantGroup section */ 240 | FABC39531AB651F100C7765D /* Main.storyboard */ = { 241 | isa = PBXVariantGroup; 242 | children = ( 243 | FABC39541AB651F100C7765D /* Base */, 244 | ); 245 | name = Main.storyboard; 246 | sourceTree = ""; 247 | }; 248 | FABC39581AB651F100C7765D /* LaunchScreen.xib */ = { 249 | isa = PBXVariantGroup; 250 | children = ( 251 | FABC39591AB651F100C7765D /* Base */, 252 | ); 253 | name = LaunchScreen.xib; 254 | sourceTree = ""; 255 | }; 256 | /* End PBXVariantGroup section */ 257 | 258 | /* Begin XCBuildConfiguration section */ 259 | FABC39671AB651F100C7765D /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 264 | CLANG_CXX_LIBRARY = "libc++"; 265 | CLANG_ENABLE_MODULES = YES; 266 | CLANG_ENABLE_OBJC_ARC = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_CONSTANT_CONVERSION = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INT_CONVERSION = YES; 273 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 274 | CLANG_WARN_UNREACHABLE_CODE = YES; 275 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 276 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_STRICT_OBJC_MSGSEND = YES; 280 | ENABLE_TESTABILITY = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu99; 282 | GCC_DYNAMIC_NO_PIC = NO; 283 | GCC_NO_COMMON_BLOCKS = YES; 284 | GCC_OPTIMIZATION_LEVEL = 0; 285 | GCC_PREPROCESSOR_DEFINITIONS = ( 286 | "DEBUG=1", 287 | "$(inherited)", 288 | ); 289 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 297 | MTL_ENABLE_DEBUG_INFO = YES; 298 | ONLY_ACTIVE_ARCH = YES; 299 | RUN_CLANG_STATIC_ANALYZER = YES; 300 | SDKROOT = iphoneos; 301 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 302 | TARGETED_DEVICE_FAMILY = "1,2"; 303 | }; 304 | name = Debug; 305 | }; 306 | FABC39681AB651F100C7765D /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ALWAYS_SEARCH_USER_PATHS = NO; 310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 311 | CLANG_CXX_LIBRARY = "libc++"; 312 | CLANG_ENABLE_MODULES = YES; 313 | CLANG_ENABLE_OBJC_ARC = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_CONSTANT_CONVERSION = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_UNREACHABLE_CODE = YES; 322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 324 | COPY_PHASE_STRIP = NO; 325 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 326 | ENABLE_NS_ASSERTIONS = NO; 327 | ENABLE_STRICT_OBJC_MSGSEND = YES; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_NO_COMMON_BLOCKS = YES; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 337 | MTL_ENABLE_DEBUG_INFO = NO; 338 | RUN_CLANG_STATIC_ANALYZER = YES; 339 | SDKROOT = iphoneos; 340 | TARGETED_DEVICE_FAMILY = "1,2"; 341 | VALIDATE_PRODUCT = YES; 342 | }; 343 | name = Release; 344 | }; 345 | FABC396A1AB651F100C7765D /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 349 | INFOPLIST_FILE = MultiThreading/Info.plist; 350 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 351 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.gfx.$(PRODUCT_NAME:rfc1034identifier)"; 352 | PRODUCT_NAME = "$(TARGET_NAME)"; 353 | }; 354 | name = Debug; 355 | }; 356 | FABC396B1AB651F100C7765D /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | INFOPLIST_FILE = MultiThreading/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 362 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.gfx.$(PRODUCT_NAME:rfc1034identifier)"; 363 | PRODUCT_NAME = "$(TARGET_NAME)"; 364 | }; 365 | name = Release; 366 | }; 367 | FABC396D1AB651F100C7765D /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | BUNDLE_LOADER = "$(TEST_HOST)"; 371 | FRAMEWORK_SEARCH_PATHS = ( 372 | "$(SDKROOT)/Developer/Library/Frameworks", 373 | "$(inherited)", 374 | ); 375 | GCC_PREPROCESSOR_DEFINITIONS = ( 376 | "DEBUG=1", 377 | "$(inherited)", 378 | ); 379 | INFOPLIST_FILE = MultiThreadingTests/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 381 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.gfx.$(PRODUCT_NAME:rfc1034identifier)"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MultiThreading.app/MultiThreading"; 384 | }; 385 | name = Debug; 386 | }; 387 | FABC396E1AB651F100C7765D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | BUNDLE_LOADER = "$(TEST_HOST)"; 391 | FRAMEWORK_SEARCH_PATHS = ( 392 | "$(SDKROOT)/Developer/Library/Frameworks", 393 | "$(inherited)", 394 | ); 395 | INFOPLIST_FILE = MultiThreadingTests/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 397 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.gfx.$(PRODUCT_NAME:rfc1034identifier)"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MultiThreading.app/MultiThreading"; 400 | }; 401 | name = Release; 402 | }; 403 | /* End XCBuildConfiguration section */ 404 | 405 | /* Begin XCConfigurationList section */ 406 | FABC39451AB651F100C7765D /* Build configuration list for PBXProject "MultiThreading" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | FABC39671AB651F100C7765D /* Debug */, 410 | FABC39681AB651F100C7765D /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | defaultConfigurationName = Release; 414 | }; 415 | FABC39691AB651F100C7765D /* Build configuration list for PBXNativeTarget "MultiThreading" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | FABC396A1AB651F100C7765D /* Debug */, 419 | FABC396B1AB651F100C7765D /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | FABC396C1AB651F100C7765D /* Build configuration list for PBXNativeTarget "MultiThreadingTests" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | FABC396D1AB651F100C7765D /* Debug */, 428 | FABC396E1AB651F100C7765D /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = FABC39421AB651F100C7765D /* Project object */; 436 | } 437 | --------------------------------------------------------------------------------