Author: tabish
Date: Tue Sep 22 14:26:16 2009
New Revision: 817674
URL: http://svn.apache.org/viewvc?rev=817674&view=rev
Log:
Switch code to use the Thread::getId method instead of a direct platform call.
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/unix/MutexImpl.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/MutexImpl.cpp
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/unix/MutexImpl.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/unix/MutexImpl.cpp?rev=817674&r1=817673&r2=817674&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/unix/MutexImpl.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/unix/MutexImpl.cpp
Tue Sep 22 14:26:16 2009
@@ -19,7 +19,7 @@
#include <decaf/internal/util/concurrent/unix/MutexHandle.h>
#include <decaf/lang/exceptions/RuntimeException.h>
-#include <decaf/internal/lang/ThreadImpl.h>
+#include <decaf/lang/Thread.h>
#include <list>
#include <memory>
@@ -32,7 +32,6 @@
using namespace decaf::util;
using namespace decaf::util::concurrent;
using namespace decaf::internal;
-using namespace decaf::internal::lang;
using namespace decaf::internal::util;
using namespace decaf::internal::util::concurrent;
using namespace decaf::lang;
@@ -58,7 +57,7 @@
////////////////////////////////////////////////////////////////////////////////
void MutexImpl::lock( MutexHandle* handle ) {
- long long threadId = ThreadImpl::getThreadId();
+ long long threadId = Thread::getId();
if( threadId == handle->lock_owner ) {
handle->lock_count++;
@@ -78,7 +77,7 @@
////////////////////////////////////////////////////////////////////////////////
bool MutexImpl::trylock( MutexHandle* handle ) {
- long long threadId = ThreadImpl::getThreadId();
+ long long threadId = Thread::getId();
if( threadId == handle->lock_owner ) {
handle->lock_count++;
@@ -102,7 +101,7 @@
return;
}
- if( handle->lock_owner != ThreadImpl::getThreadId() ) {
+ if( handle->lock_owner != Thread::getId() ) {
throw RuntimeException(
__FILE__, __LINE__,
"Unlock Failed, this thread is not the Lock Owner!" );
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/MutexImpl.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/MutexImpl.cpp?rev=817674&r1=817673&r2=817674&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/MutexImpl.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/MutexImpl.cpp
Tue Sep 22 14:26:16 2009
@@ -19,7 +19,7 @@
#include <decaf/internal/util/concurrent/windows/MutexHandle.h>
#include <decaf/lang/exceptions/RuntimeException.h>
-#include <decaf/internal/lang/ThreadImpl.h>
+#include <decaf/lang/Thread.h>
#include <memory>
@@ -27,7 +27,6 @@
using namespace decaf::util;
using namespace decaf::util::concurrent;
using namespace decaf::internal;
-using namespace decaf::internal::lang;
using namespace decaf::internal::util;
using namespace decaf::internal::util::concurrent;
using namespace decaf::lang;
@@ -54,7 +53,7 @@
////////////////////////////////////////////////////////////////////////////////
void MutexImpl::lock( MutexHandle* handle ) {
- long long threadId = ThreadImpl::getThreadId();
+ long long threadId = Thread::getId();
if( threadId == handle->lock_owner ) {
handle->lock_count++;
@@ -76,7 +75,7 @@
////////////////////////////////////////////////////////////////////////////////
bool MutexImpl::trylock( MutexHandle* handle ) {
- long long threadId = ThreadImpl::getThreadId();
+ long long threadId = Thread::getId();
if( threadId == handle->lock_owner ) {
handle->lock_count++;
@@ -109,7 +108,7 @@
return;
}
- if( handle->lock_owner != ThreadImpl::getThreadId() ) {
+ if( handle->lock_owner != Thread::getId() ) {
throw RuntimeException(
__FILE__, __LINE__,
"Unlock Failed, this thread is not the Lock Owner!" );