From e33dab4299226c3bc317142cbc3dd4697f0bfe61 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 25 Aug 2000 01:35:06 +0000 Subject: [PATCH] added isCurrentThread() member func --- src/libCom/osi/osiThread.cpp | 4 ++++ src/libCom/osi/osiThread.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libCom/osi/osiThread.cpp b/src/libCom/osi/osiThread.cpp index 720d601c5..843b0844e 100644 --- a/src/libCom/osi/osiThread.cpp +++ b/src/libCom/osi/osiThread.cpp @@ -47,3 +47,7 @@ void osiThread::start () this->begin.signal (); } +bool osiThread::isCurrentThread () const +{ + return ( threadGetIdSelf () == this->id ); +} diff --git a/src/libCom/osi/osiThread.h b/src/libCom/osi/osiThread.h index 49c54321f..ffca88fe0 100644 --- a/src/libCom/osi/osiThread.h +++ b/src/libCom/osi/osiThread.h @@ -112,7 +112,7 @@ public: void setPriority (unsigned); bool priorityIsEqual (const osiThread &otherThread) const; bool isSuspended () const; - + bool isCurrentThread () const; bool operator == (const osiThread &rhs) const; /* these operate on the current thread */