ReXGlue SDK
Loading...
Searching...
No Matches
thread.h File Reference
#include <algorithm>
#include <atomic>
#include <chrono>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <stop_token>
#include <string>
#include <string_view>
#include <thread>
#include <utility>
#include <vector>
#include <rex/assert.h>
#include <rex/platform.h>
#include <rex/platform/process.h>
#include <rex/platform/sync.h>
#include <rex/types.h>
#include <rex/utility.h>

Go to the source code of this file.

Classes

struct  rex::platform::ThreadPriority
class  rex::platform::Thread
struct  rex::platform::Thread::CreationParameters
struct  rex::platform::Fiber
struct  rex::ThreadStop

Namespaces

namespace  rex
namespace  rex::platform

Typedefs

using rex::platform::TLSHandle = u32

Enumerations

enum class  rex::platform::SleepResult : u8 { kSuccess , rex::platform::kAlerted }

Functions

u32 rex::platform::GetLogicalProcessorCount ()
void rex::platform::WidenProcessAffinity ()
u32 rex::platform::GetCallerSystemThreadID ()
u32 rex::platform::GetCallerThreadID ()
void rex::platform::SetCallerThreadID (u32 id)
void rex::platform::SetCurrentThreadName (const std::string_view name)
void rex::platform::SetCurrentThreadPriority (i32 priority)
void rex::platform::MaybeYield ()
void rex::platform::SyncMemory ()
void rex::platform::SleepFor (std::chrono::microseconds duration)
template<typename Rep, typename Period>
void rex::platform::SleepFor (std::chrono::duration< Rep, Period > duration)
std::chrono::milliseconds rex::platform::GetCurrentThreadCPUTime ()
SleepResult rex::platform::AlertableSleep (std::chrono::microseconds duration)
template<typename Rep, typename Period>
SleepResult rex::platform::AlertableSleep (std::chrono::duration< Rep, Period > duration)
TLSHandle rex::platform::AllocateTLSHandle ()
bool rex::platform::FreeTLSHandle (TLSHandle handle)
uintptr_t rex::platform::GetTLSValue (TLSHandle handle)
bool rex::platform::SetTLSValue (TLSHandle handle, uintptr_t value)
template<typename F>
std::jthread rex::platform::Spawn (std::string_view name, F &&fn)

Variables

constexpr TLSHandle rex::platform::kInvalidTLSHandle = UINT_MAX

Detailed Description

License
BSD 3-Clause License See LICENSE file in the project root for full license text.
Remarks
Derived from Xenia's xenia/base/threading.h (Ben Vanik, 2020).