Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of GCD in asynchronous context #185

Open
jbelkins opened this issue May 5, 2023 · 0 comments
Open

Use of GCD in asynchronous context #185

jbelkins opened this issue May 5, 2023 · 0 comments
Assignees
Labels
bug This issue is a bug. needs-review p2 This is a standard priority issue

Comments

@jbelkins
Copy link
Contributor

jbelkins commented May 5, 2023

Describe the bug

GCD semaphores can cause unpredictable behavior when used from within a Swift asynchronous task.

The following was seen in the build logs when building aws-crt-swift:

/Users/runner/work/aws-sdk-swift/aws-sdk-swift/target/build/deps/aws-crt-swift/Source/Elasticurl/Elasticurl.swift:320:23: warning: instance method 'wait' is unavailable from asynchronous contexts; Await a Task handle instead; this is an error in Swift 6
            semaphore.wait()
                      ^
Dispatch.DispatchSemaphore:4:17: note: 'wait()' declared here
    public func wait()

Expected Behavior

aws-crt-swift does not use GCD semaphores within asynchronous code, and this warning is not generated

Current Behavior

The warning above (soon to be raised to an error) is generated at build time

Reproduction Steps

Build aws-crt-swift, observe build logs

Possible Solution

No response

Additional Information/Context

No response

AWS CRT SWIFT version used

0.9.0

Compiler and Version used

Xcode 14.3

Operating System and version

macOS 13.3.1

@jbelkins jbelkins added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 5, 2023
@yasminetalby yasminetalby added the p2 This is a standard priority issue label Jun 25, 2023
@yasminetalby yasminetalby added needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Sep 6, 2023
@yasminetalby yasminetalby self-assigned this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-review p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants