18 #ifndef UTHREADS_KTHREADS_H_ 19 #define UTHREADS_KTHREADS_H_ 23 #include <condition_variable> 25 #include "../generic/basics.h" 57 friend class IOHandler;
58 friend class Scheduler;
96 std::thread::id threadID;
102 std::thread threadSelf;
129 static __thread
kThread* currentKT;
131 static std::atomic_uint totalNumberofKTs;
144 static void defaultRun(
void*) __noreturn;
151 void runWithFunc(std::function<
void(ptr_t)>, ptr_t);
155 void initializeMainUT(
bool);
157 void switchContext(
uThread*,
void* args =
nullptr);
159 void switchContext(
void* args =
nullptr);
167 static inline void postSwitchFunc(
uThread*,
void*) __noreturn;
175 static __thread funcvoid2_t postSuspendFunc;
178 static __thread KTLocal* ktlocal;
180 void initialSynchronization();
210 std::thread::id
getID();
std::thread::native_handle_type getThreadNativeHandle()
return the native hanlde for the kernel thread
Definition: kThread.cpp:202
static kThread * currentkThread()
Get the pointer to the current kThread.
Definition: kThread.h:219
Object to represent kernel threads.
Definition: kThread.h:54
static uint getTotalNumberOfkThreads()
Definition: kThread.h:226
user-level threads (fiber)
Definition: uThread.h:63
Scheduler and Cluster of kThreads.
Definition: Cluster.h:61
const kThread & operator=(const kThread &)=delete
kThread cannot be copied or assigned.
std::thread::id getID()
returns the kernel thread ID
Definition: kThread.cpp:209