mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-02-03 04:11:08 +00:00
Add a threadID function
This commit is contained in:
parent
13af957ab9
commit
43bd44b6ca
|
@ -118,6 +118,7 @@ class TCThread : public TCThreadBase {
|
||||||
TCThread(TCCallable &);
|
TCThread(TCCallable &);
|
||||||
|
|
||||||
static void Yield();
|
static void Yield();
|
||||||
|
static uint64 ThreadID();
|
||||||
void Join();
|
void Join();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,15 @@ void TCThread::Yield() {
|
||||||
boost::thread::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
|
// Mutex Implementation
|
||||||
|
|
|
@ -134,6 +134,10 @@ void TCThread::Yield() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64 TCThread::ThreadID() {
|
||||||
|
return static_cast<uint64>(pthread_self());
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Mutex Implementation
|
// Mutex Implementation
|
||||||
|
|
Loading…
Reference in a new issue