diff --git a/src/system/libroot/os/arch/riscv64/tls.cpp b/src/system/libroot/os/arch/riscv64/tls.cpp index 8d50e92ccd..c366330fd7 100644 --- a/src/system/libroot/os/arch/riscv64/tls.cpp +++ b/src/system/libroot/os/arch/riscv64/tls.cpp @@ -1,8 +1,11 @@ /* - * Copyright 2019-2021, Haiku, Inc. All Rights Reserved. + * Copyright 2019-2021, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ + +#include + #include #include "support/TLS.h" @@ -16,8 +19,8 @@ struct tls_index { extern "C" void* __tls_get_addr(struct tls_index* ti); -// TODO: use std::atomic here like x86_64 -static int32 gNextSlot = TLS_FIRST_FREE_SLOT; + +static std::atomic gNextSlot(TLS_FIRST_FREE_SLOT); static inline void**