Skip to content

Commit 9c2d8fb

Browse files
neakorrudro
authored andcommitted
Fix AtomicInt usages of deprecated atomic APIs (#26)
* Fix AtomicInt usages of deprecated atomic APIs As of iOS 10.0 and MacOS 10.12 the old `OSMemoryBarrier`, `OSAtomicCompareAndSwap64Barrier`, `OSAtomicIncrement64Barrier`, and `OSAtomicDecrement64Barrier, APIs are deprecated. The warnings suggested new APIs are C++ and are not accessible from Swift. `OSMemoryBarrier` can be directly replaced with `atomic_thread_fence(memory_order_seq_cst)` which is accessible from Swift. The rest of the suggested C++ APIs `atomic_fetch_add`, `atomic_fetch_sub`, and `atomic_compare_exchange_strong` are not accessible from Swift. This change creates a Objective-C wrapper for these C++ APIs, so Swift code can access them. * Update TravisCI to use Xcode 10.1
1 parent 7ead5bc commit 9c2d8fb

File tree

14 files changed

+470
-201
lines changed

14 files changed

+470
-201
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ Packages/
3535
Package.pins
3636
Package.resolved
3737
.build/
38+
.DS_Store

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: objective-c
2-
osx_image: xcode9
2+
osx_image: xcode10.1
33

44
env:
55
- ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
6-
- ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone 7'
7-
- ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p'
6+
- ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone XS'
7+
- ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV 4K'
88

99
script:
1010
- swift test
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32
<plist version="1.0">
43
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
7-
<key>CFBundleExecutable</key>
8-
<string>$(EXECUTABLE_NAME)</string>
9-
<key>CFBundleIdentifier</key>
10-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11-
<key>CFBundleInfoDictionaryVersion</key>
12-
<string>6.0</string>
13-
<key>CFBundleName</key>
14-
<string>$(PRODUCT_NAME)</string>
15-
<key>CFBundlePackageType</key>
16-
<string>FMWK</string>
17-
<key>CFBundleShortVersionString</key>
18-
<string>0.6.1</string>
19-
<key>CFBundleSignature</key>
20-
<string>????</string>
21-
<key>CFBundleVersion</key>
22-
<string>0.6.1</string>
23-
<key>NSPrincipalClass</key>
24-
<string></string>
4+
<key>CFBundleDevelopmentRegion</key>
5+
<string>en</string>
6+
<key>CFBundleExecutable</key>
7+
<string>$(EXECUTABLE_NAME)</string>
8+
<key>CFBundleIdentifier</key>
9+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
10+
<key>CFBundleInfoDictionaryVersion</key>
11+
<string>6.0</string>
12+
<key>CFBundleName</key>
13+
<string>$(PRODUCT_NAME)</string>
14+
<key>CFBundlePackageType</key>
15+
<string>FMWK</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>1.0</string>
18+
<key>CFBundleSignature</key>
19+
<string>????</string>
20+
<key>CFBundleVersion</key>
21+
<string>$(CURRENT_PROJECT_VERSION)</string>
22+
<key>NSPrincipalClass</key>
23+
<string></string>
2524
</dict>
2625
</plist>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ObjCBridges {
2+
umbrella "/Users/yiw/Uber/GitHub/swift-concurrency/Sources/ObjCBridges/include"
3+
export *
4+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<plist version="1.0">
3+
<dict>
4+
<key>CFBundleDevelopmentRegion</key>
5+
<string>en</string>
6+
<key>CFBundleExecutable</key>
7+
<string>$(EXECUTABLE_NAME)</string>
8+
<key>CFBundleIdentifier</key>
9+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
10+
<key>CFBundleInfoDictionaryVersion</key>
11+
<string>6.0</string>
12+
<key>CFBundleName</key>
13+
<string>$(PRODUCT_NAME)</string>
14+
<key>CFBundlePackageType</key>
15+
<string>FMWK</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>1.0</string>
18+
<key>CFBundleSignature</key>
19+
<string>????</string>
20+
<key>CFBundleVersion</key>
21+
<string>$(CURRENT_PROJECT_VERSION)</string>
22+
<key>NSPrincipalClass</key>
23+
<string></string>
24+
</dict>
25+
</plist>

Concurrency.xcodeproj/project.pbxproj

Lines changed: 326 additions & 140 deletions
Large diffs are not rendered by default.

Concurrency.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
6+
<false/>
7+
</dict>
8+
</plist>

Concurrency.xcodeproj/xcshareddata/xcschemes/Concurrency.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1010"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Concurrency.xcodeproj/xcshareddata/xcschemes/ConcurrencyTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1010"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)