Skip to content

Commit

Permalink
Remove use of ATOMIC_VAR_INIT (ray-project#32828)
Browse files Browse the repository at this point in the history
ATOMIC_VAR_INIT has a trivial definition
`#define ATOMIC_VAR_INIT(value) (value)`,
is deprecated in C17/C++20, and will be removed in newer standards in
newer GCC/Clang (e.g. https://reviews.llvm.org/D144196).

Signed-off-by: Fangrui Song <[email protected]>
  • Loading branch information
MaskRay authored Feb 28, 2023
1 parent c63e429 commit a6855b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ray/util/process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ typedef NTSTATUS WINAPI NtQueryInformationProcess_t(HANDLE ProcessHandle,
ULONG ProcessInformationLength,
ULONG *ReturnLength);

static std::atomic<NtQueryInformationProcess_t *> NtQueryInformationProcess_ =
ATOMIC_VAR_INIT(NULL);
static std::atomic<NtQueryInformationProcess_t *> NtQueryInformationProcess_ = NULL;

pid_t GetParentPID() {
NtQueryInformationProcess_t *NtQueryInformationProcess = NtQueryInformationProcess_;
Expand Down

0 comments on commit a6855b9

Please sign in to comment.