LeviLamina
Loading...
Searching...
No Matches
Tls.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/platform/NonCopyable.h"
7#include "mc/platform/brstd/bitset.h"
8#include "mc/platform/brstd/flat_set.h"
9
10namespace Bedrock::Threading::Detail {
11
12class Tls {
13public:
14 // Tls inner types declare
15 // clang-format off
16 struct Thread;
17 // clang-format on
18
19 // Tls inner types define
20 struct Thread : public ::Bedrock::NonCopyable {
21 public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 8, ::Bedrock::Threading::Detail::Tls*&> mTls;
25 ::ll::TypedStorage<8, 24, ::std::vector<void*>> mValues;
26 // NOLINTEND
27
28 public:
29 // prevent constructor by default
30 Thread& operator=(Thread const&);
31 Thread(Thread const&);
32 Thread();
33
34 public:
35 // member functions
36 // NOLINTBEGIN
37 MCAPI explicit Thread(::Bedrock::Threading::Detail::Tls*& tls);
38 // NOLINTEND
39
40 public:
41 // constructor thunks
42 // NOLINTBEGIN
43 MCAPI void* $ctor(::Bedrock::Threading::Detail::Tls*& tls);
44 // NOLINTEND
45 };
46
47 using Key = uint;
48
49public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 80, ::std::mutex> mMutex;
53 ::ll::TypedStorage<8, 24, ::std::vector<::brstd::bitset<1024, uint64>>> mSlots;
54 ::ll::TypedStorage<
55 8,
56 24,
59 ::std::less<::Bedrock::Threading::Detail::Tls::Thread*>,
60 ::std::vector<::Bedrock::Threading::Detail::Tls::Thread*>>>
61 mThreads;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI uint allocate();
68
69 MCAPI void free(uint key);
70
71 MCAPI void registerThread(::Bedrock::Threading::Detail::Tls::Thread& thread);
72 // NOLINTEND
73};
74
75} // namespace Bedrock::Threading::Detail
Definition NonCopyable.h:7
Definition flat_set.h:10