1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef THREAD_H 6 #define THREAD_H 7 8 #include <OS.h> 9 10 11 namespace BKernel { 12 struct Thread; 13 } 14 15 using BKernel::Thread; 16 17 18 static inline Thread* 19 get_current_thread() 20 { 21 return (Thread*)(addr_t)find_thread(NULL); 22 } 23 24 25 static inline thread_id 26 get_thread_id(Thread* thread) 27 { 28 return (thread_id)(addr_t)thread; 29 } 30 31 32 #endif // THREAD_H 33