SGThread: Add capability to get current thread id

This commit is contained in:
Peter Sadrozinski
2012-11-28 11:23:30 +01:00
committed by Christian Schmitt
parent c19585e22a
commit 35aae588b8
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -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()
{
+5
View File
@@ -50,6 +50,11 @@ public:
*/
void join();
/**
*Retreive the current thread id.
*/
static long current( void );
protected:
/**
* Destroy a thread object.