summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-08-21 14:18:40 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-08-21 14:19:10 +0200
commit19277d02fb996058e896725bae7500f356f08af0 (patch)
tree243a2fc5bbba794f03a865527407304aa2de4554 /cppu
parentbcce27d2832a2b098a42cbbd365df35948b9d0ac (diff)
osl_getThreadIdentifier(0) -> osl::Thread::getCurrentIdentifier()
Change-Id: Ida9785c4b9fda0459769957734952e69d7a9de44
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/AffineBridge/AffineBridge.cxx16
-rw-r--r--cppu/source/LogBridge/LogBridge.cxx7
-rw-r--r--cppu/source/UnsafeBridge/UnsafeBridge.cxx7
-rw-r--r--cppu/source/threadpool/threadident.cxx4
-rw-r--r--cppu/source/uno/EnvStack.cxx5
5 files changed, 21 insertions, 18 deletions
diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx
index 1495f56adcc2..5a23ae212d0d 100644
--- a/cppu/source/AffineBridge/AffineBridge.cxx
+++ b/cppu/source/AffineBridge/AffineBridge.cxx
@@ -145,7 +145,7 @@ AffineBridge::~AffineBridge(void)
{
LOG_LIFECYCLE_AffineBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "AffineBridge::~AffineBridge(void)", this));
- if (m_pInnerThread && osl_getThreadIdentifier(NULL) != m_innerThreadId)
+ if (m_pInnerThread && osl::Thread::getCurrentIdentifier() != m_innerThreadId)
{
m_message = CB_DONE;
m_innerCondition.set();
@@ -165,7 +165,7 @@ AffineBridge::~AffineBridge(void)
void AffineBridge::outerDispatch(int loop)
{
- OSL_ASSERT(m_outerThreadId == osl_getThreadIdentifier(NULL));
+ OSL_ASSERT(m_outerThreadId == osl::Thread::getCurrentIdentifier());
OSL_ASSERT(m_innerThreadId != m_outerThreadId);
Msg mm;
@@ -204,7 +204,7 @@ void AffineBridge::outerDispatch(int loop)
void AffineBridge::innerDispatch(void)
{
- OSL_ASSERT(m_innerThreadId == osl_getThreadIdentifier(NULL));
+ OSL_ASSERT(m_innerThreadId == osl::Thread::getCurrentIdentifier());
OSL_ASSERT(m_innerThreadId != m_outerThreadId);
Msg mm;
@@ -249,7 +249,7 @@ void AffineBridge::v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam)
bool resetId = false;
if (!m_outerThreadId)
{
- m_outerThreadId = osl_getThreadIdentifier(NULL);
+ m_outerThreadId = osl::Thread::getCurrentIdentifier();
resetId = true;
}
@@ -299,16 +299,16 @@ void AffineBridge::v_enter(void)
m_innerMutex.acquire();
if (!m_enterCount)
- m_innerThreadId = osl_getThreadIdentifier(NULL);
+ m_innerThreadId = osl::Thread::getCurrentIdentifier();
- OSL_ASSERT(m_innerThreadId == osl_getThreadIdentifier(NULL));
+ OSL_ASSERT(m_innerThreadId == osl::Thread::getCurrentIdentifier());
++ m_enterCount;
}
void AffineBridge::v_leave(void)
{
- OSL_ASSERT(m_innerThreadId == osl_getThreadIdentifier(NULL));
+ OSL_ASSERT(m_innerThreadId == osl::Thread::getCurrentIdentifier());
-- m_enterCount;
if (!m_enterCount)
@@ -325,7 +325,7 @@ int AffineBridge::v_isValid(rtl::OUString * pReason)
else
{
- result = m_innerThreadId == osl_getThreadIdentifier(NULL);
+ result = m_innerThreadId == osl::Thread::getCurrentIdentifier();
if (!result)
*pReason = rtl::OUString("wrong thread");
diff --git a/cppu/source/LogBridge/LogBridge.cxx b/cppu/source/LogBridge/LogBridge.cxx
index ec140d7d5c16..f6be81dec24d 100644
--- a/cppu/source/LogBridge/LogBridge.cxx
+++ b/cppu/source/LogBridge/LogBridge.cxx
@@ -20,6 +20,7 @@
#include "osl/mutex.hxx"
#include "osl/thread.h"
+#include "osl/thread.hxx"
#include "uno/dispatcher.h"
#include "typelib/typedescription.hxx"
#include "cppu/helper/purpenv/Environment.hxx"
@@ -79,7 +80,7 @@ void LogBridge::v_callOut_v(uno_EnvCallee * pCallee, va_list * pParam)
++ m_count;
if (!m_threadId)
- m_threadId = osl_getThreadIdentifier(NULL);
+ m_threadId = osl::Thread::getCurrentIdentifier();
}
void LogBridge::v_enter(void)
@@ -89,7 +90,7 @@ void LogBridge::v_enter(void)
OSL_ASSERT(m_count >= 0);
if (m_count == 0)
- m_threadId = osl_getThreadIdentifier(NULL);
+ m_threadId = osl::Thread::getCurrentIdentifier();
++ m_count;
}
@@ -115,7 +116,7 @@ int LogBridge::v_isValid(rtl::OUString * pReason)
}
else
{
- result = m_threadId == osl_getThreadIdentifier(NULL);
+ result = m_threadId == osl::Thread::getCurrentIdentifier();
if (!result)
*pReason = rtl::OUString("wrong thread");
diff --git a/cppu/source/UnsafeBridge/UnsafeBridge.cxx b/cppu/source/UnsafeBridge/UnsafeBridge.cxx
index 6a5f4831f282..511969116dbb 100644
--- a/cppu/source/UnsafeBridge/UnsafeBridge.cxx
+++ b/cppu/source/UnsafeBridge/UnsafeBridge.cxx
@@ -20,6 +20,7 @@
#include "osl/mutex.hxx"
#include "osl/thread.h"
+#include "osl/thread.hxx"
#include "cppu/helper/purpenv/Environment.hxx"
#include "cppu/helper/purpenv/Mapping.hxx"
@@ -89,7 +90,7 @@ void UnsafeBridge::v_callOut_v(uno_EnvCallee * pCallee, va_list * pParam)
++ m_count;
if (!m_threadId)
- m_threadId = osl_getThreadIdentifier(NULL);
+ m_threadId = osl::Thread::getCurrentIdentifier();
}
void UnsafeBridge::v_enter(void)
@@ -99,7 +100,7 @@ void UnsafeBridge::v_enter(void)
OSL_ASSERT(m_count >= 0);
if (m_count == 0)
- m_threadId = osl_getThreadIdentifier(NULL);
+ m_threadId = osl::Thread::getCurrentIdentifier();
++ m_count;
}
@@ -125,7 +126,7 @@ int UnsafeBridge::v_isValid(rtl::OUString * pReason)
}
else
{
- result = m_threadId == osl_getThreadIdentifier(NULL);
+ result = m_threadId == osl::Thread::getCurrentIdentifier();
if (!result)
*pReason = rtl::OUString("wrong thread");
diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx
index 3e0ab4917a71..82c43d5dafc6 100644
--- a/cppu/source/threadpool/threadident.cxx
+++ b/cppu/source/threadpool/threadident.cxx
@@ -22,7 +22,7 @@
#include <list>
#include <osl/mutex.hxx>
-#include <osl/thread.h>
+#include <osl/thread.hxx>
#include <osl/diagnose.h>
#include <rtl/process.h>
@@ -42,7 +42,7 @@ using namespace ::cppu;
static inline void createLocalId( sal_Sequence **ppThreadId )
{
rtl_byte_sequence_constructNoDefault( ppThreadId , 4 + 16 );
- sal_uInt32 id = osl_getThreadIdentifier(0);
+ sal_uInt32 id = osl::Thread::getCurrentIdentifier();
(*ppThreadId)->elements[0] = id & 0xFF;
(*ppThreadId)->elements[1] = (id >> 8) & 0xFF;
(*ppThreadId)->elements[2] = (id >> 16) & 0xFF;
diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 22d7bd992909..59da613a0623 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -25,6 +25,7 @@
#include "rtl/instance.hxx"
#include "osl/thread.h"
+#include "osl/thread.hxx"
#include "osl/mutex.hxx"
#include <boost/unordered_map.hpp>
@@ -69,7 +70,7 @@ namespace
static void s_setCurrent(uno_Environment * pEnv)
{
- oslThreadIdentifier threadId = osl_getThreadIdentifier(NULL);
+ oslThreadIdentifier threadId = osl::Thread::getCurrentIdentifier();
osl::MutexGuard guard(s_threadMap_mutex::get());
ThreadMap &rThreadMap = s_threadMap::get();
@@ -89,7 +90,7 @@ static uno_Environment * s_getCurrent(void)
{
uno_Environment * pEnv = NULL;
- oslThreadIdentifier threadId = osl_getThreadIdentifier(NULL);
+ oslThreadIdentifier threadId = osl::Thread::getCurrentIdentifier();
osl::MutexGuard guard(s_threadMap_mutex::get());
ThreadMap &rThreadMap = s_threadMap::get();