Skip to content

Commit

Permalink
- fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Belozierov committed Mar 27, 2020
1 parent 9a3af27 commit 85efda9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions Sources/CCoroutine/CCoroutine.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ int __save(jmp_buf env, jmp_buf ret, int retVal) {
_longjmp(env, retVal);
}

int __atomicCompareExchange(_Atomic long* value, long* expected, long desired) {
return atomic_compare_exchange_weak(value, expected, desired);
}

long __atomicExchange(_Atomic long* value, long desired) {
return atomic_exchange(value, desired);
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftCoroutine/Coroutine/Coroutine/Coroutine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct Coroutine {
// MARK: - await

@inlinable public static func await(_ callback: (@escaping () -> Void) -> Void) throws {
try await { callback($0) }
try current().await { completion in callback { completion(()) } }
}

@inlinable public static func await<T>(_ callback: (@escaping (T) -> Void) -> Void) throws -> T {
Expand Down
1 change: 0 additions & 1 deletion Tests/SwiftCoroutineTests/Coroutine/CoroutineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class CoroutineTests: XCTestCase {
completion(Int.random(in: 0..<1000))
}
} + a
print(b)
exp.fulfill()
}
}
Expand Down

0 comments on commit 85efda9

Please sign in to comment.