mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-22 23:23:46 +00:00
Add a threadID function
This commit is contained in:
parent
13af957ab9
commit
43bd44b6ca
3 changed files with 14 additions and 0 deletions
|
@ -118,6 +118,7 @@ class TCThread : public TCThreadBase {
|
|||
TCThread(TCCallable &);
|
||||
|
||||
static void Yield();
|
||||
static uint64 ThreadID();
|
||||
void Join();
|
||||
};
|
||||
|
||||
|
|
|
@ -103,6 +103,15 @@ void TCThread::Yield() {
|
|||
boost::thread::yield();
|
||||
}
|
||||
|
||||
uint64 TCThread::ThreadID() {
|
||||
boost::thread::id thisID = boost::this_thread::get_id();
|
||||
std::stringstream ss;
|
||||
ss << thisID;
|
||||
uint64 retID;
|
||||
ss >> retID;
|
||||
return retID;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Mutex Implementation
|
||||
|
|
|
@ -134,6 +134,10 @@ void TCThread::Yield() {
|
|||
}
|
||||
}
|
||||
|
||||
uint64 TCThread::ThreadID() {
|
||||
return static_cast<uint64>(pthread_self());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Mutex Implementation
|
||||
|
|
Loading…
Reference in a new issue