SGThread: Add capability to get current thread id
This commit is contained in:
parent
c19585e22a
commit
35aae588b8
@ -81,6 +81,10 @@ struct SGThread::PrivateData {
|
||||
HANDLE _handle;
|
||||
};
|
||||
|
||||
static long SGThread::current( void ) {
|
||||
return (long)GetCurrentThreadId();
|
||||
}
|
||||
|
||||
struct SGMutex::PrivateData {
|
||||
PrivateData()
|
||||
{
|
||||
@ -227,6 +231,10 @@ struct SGThread::PrivateData {
|
||||
bool _started;
|
||||
};
|
||||
|
||||
long SGThread::current( void ) {
|
||||
return (long)pthread_self();
|
||||
}
|
||||
|
||||
struct SGMutex::PrivateData {
|
||||
PrivateData()
|
||||
{
|
||||
|
@ -50,6 +50,11 @@ public:
|
||||
*/
|
||||
void join();
|
||||
|
||||
/**
|
||||
*Retreive the current thread id.
|
||||
*/
|
||||
static long current( void );
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Destroy a thread object.
|
||||
|
Loading…
Reference in New Issue
Block a user