Added Thread::CurrentThreadId() method to wrap up thread id functionality in a more platform appropriate way.
This commit is contained in:
@@ -113,6 +113,11 @@ public:
|
||||
*/
|
||||
static Thread *CurrentThread();
|
||||
|
||||
/**
|
||||
* Return the id of the current thread
|
||||
*/
|
||||
static size_t CurrentThreadId();
|
||||
|
||||
|
||||
/**
|
||||
* Initialize Threading in a program. This method must be called before
|
||||
@@ -147,7 +152,7 @@ public:
|
||||
*
|
||||
* @return a unique thread identifier
|
||||
*/
|
||||
int getThreadId();
|
||||
size_t getThreadId();
|
||||
|
||||
/**
|
||||
* Get the thread's process id. This is the pthread_t or pid_t value
|
||||
|
||||
@@ -390,7 +390,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
bool releaseContext();
|
||||
|
||||
/** Return true if the current thread has this OpenGL graphics context.*/
|
||||
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); }
|
||||
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThreadId(); }
|
||||
|
||||
/** Bind the graphics context to associated texture.*/
|
||||
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
|
||||
@@ -547,7 +547,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
Vec4 _clearColor;
|
||||
GLbitfield _clearMask;
|
||||
|
||||
OpenThreads::Thread* _threadOfLastMakeCurrent;
|
||||
size_t _threadOfLastMakeCurrent;
|
||||
|
||||
OpenThreads::Mutex _operationsMutex;
|
||||
osg::ref_ptr<osg::RefBlock> _operationsBlock;
|
||||
|
||||
Reference in New Issue
Block a user