AuroraRuntime/Include/Aurora/Threading/Threads/TLSView.hpp

25 lines
524 B
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: TLSView.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
namespace Aurora::Threading::Threads
{
struct TLSKey
{
Primitives::SpinLock lock;
void *pContext {};
};
2021-06-27 21:25:29 +00:00
struct AUKN_SYM TLSView
2021-06-27 21:25:29 +00:00
{
2022-01-19 17:08:13 +00:00
using TlsCb = AuFunction<void(void *)>;
2021-06-27 21:25:29 +00:00
static void Remove(TLSKey &key);
static void *InitTLS(TLSKey &key, AuMach length, const TlsCb &init, const TlsCb &deinit);
2021-06-27 21:25:29 +00:00
};
}