Skip to content

[Concurrency] Remove libatomic dependency on Concurrency module on Linux #38551

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

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions stdlib/public/Concurrency/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ endif()
# Frustratingly, in many cases this isn't necessary because the
# sequence is inlined, but we have some code that's just subtle
# enough to turn into runtime calls.
if(SWIFT_HOST_VARIANT STREQUAL "linux" OR
SWIFT_HOST_VARIANT STREQUAL "android")
if(SWIFT_HOST_VARIANT STREQUAL "android")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been tried on Android, I simply asked that it be added in #38508 since usually it will be needed if it is on linux. If you don't need this on linux after your change, just revert that patch instead, ie remove it for Android too.

list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS
-latomic)
endif()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/TaskPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class TaskFutureWaitAsyncContext : public AsyncContext {
} // end anonymous namespace

/// The current state of a task's status records.
class ActiveTaskStatus {
class alignas(sizeof(void*) * 2) ActiveTaskStatus {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to use sizeof(uintptr_t) to make the intent clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use void* in other places, so I wanted to keep it consistent.

enum : uintptr_t {
/// The current running priority of the task.
PriorityMask = 0xFF,
Expand Down