aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-12 15:21:16 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-12 15:21:16 +0000
commitdcbd6e358af8f1208d18dfec4bb86f8645b2a44d (patch)
tree40cad2d5df56e08db59ee9d7699911624558df05 /src/ports
parent2eba795bcda66813fdc7a7c4388a99ae9cb2c864 (diff)
remove unused bool param to SkMutex constructor
git-svn-id: http://skia.googlecode.com/svn/trunk@3025 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkThread_none.cpp22
-rw-r--r--src/ports/SkThread_pthread.cpp30
-rw-r--r--src/ports/SkThread_win.cpp18
3 files changed, 24 insertions, 46 deletions
diff --git a/src/ports/SkThread_none.cpp b/src/ports/SkThread_none.cpp
index e70acde5c5..8361021059 100644
--- a/src/ports/SkThread_none.cpp
+++ b/src/ports/SkThread_none.cpp
@@ -9,33 +9,23 @@
#include "SkThread.h"
-int32_t sk_atomic_inc(int32_t* addr)
-{
+int32_t sk_atomic_inc(int32_t* addr) {
int32_t value = *addr;
*addr = value + 1;
return value;
}
-int32_t sk_atomic_dec(int32_t* addr)
-{
+int32_t sk_atomic_dec(int32_t* addr) {
int32_t value = *addr;
*addr = value - 1;
return value;
}
-SkMutex::SkMutex(bool /* isGlobal */)
-{
-}
+SkMutex::SkMutex() {}
-SkMutex::~SkMutex()
-{
-}
+SkMutex::~SkMutex() {}
-void SkMutex::acquire()
-{
-}
+void SkMutex::acquire() {}
-void SkMutex::release()
-{
-}
+void SkMutex::release() {}
diff --git a/src/ports/SkThread_pthread.cpp b/src/ports/SkThread_pthread.cpp
index 51c0859031..638e522e3b 100644
--- a/src/ports/SkThread_pthread.cpp
+++ b/src/ports/SkThread_pthread.cpp
@@ -67,27 +67,24 @@ int32_t sk_atomic_dec(int32_t* addr)
//////////////////////////////////////////////////////////////////////////////
-static void print_pthread_error(int status)
-{
+static void print_pthread_error(int status) {
switch (status) {
case 0: // success
break;
case EINVAL:
- printf("pthread error [%d] EINVAL\n", status);
+ SkDebugf("pthread error [%d] EINVAL\n", status);
break;
case EBUSY:
- printf("pthread error [%d] EBUSY\n", status);
+ SkDebugf("pthread error [%d] EBUSY\n", status);
break;
default:
- printf("pthread error [%d] unknown\n", status);
+ SkDebugf("pthread error [%d] unknown\n", status);
break;
}
}
-SkMutex::SkMutex(bool isGlobal) : fIsGlobal(isGlobal)
-{
- if (sizeof(pthread_mutex_t) > sizeof(fStorage))
- {
+SkMutex::SkMutex() {
+ if (sizeof(pthread_mutex_t) > sizeof(fStorage)) {
SkDEBUGF(("pthread mutex size = %d\n", sizeof(pthread_mutex_t)));
SkDEBUGFAIL("mutex storage is too small");
}
@@ -104,27 +101,24 @@ SkMutex::SkMutex(bool isGlobal) : fIsGlobal(isGlobal)
SkASSERT(0 == status);
}
-SkMutex::~SkMutex()
-{
+SkMutex::~SkMutex() {
int status = pthread_mutex_destroy((pthread_mutex_t*)fStorage);
-
+#if 0
// only report errors on non-global mutexes
- if (!fIsGlobal)
- {
+ if (!fIsGlobal) {
print_pthread_error(status);
SkASSERT(0 == status);
}
+#endif
}
-void SkMutex::acquire()
-{
+void SkMutex::acquire() {
int status = pthread_mutex_lock((pthread_mutex_t*)fStorage);
print_pthread_error(status);
SkASSERT(0 == status);
}
-void SkMutex::release()
-{
+void SkMutex::release() {
int status = pthread_mutex_unlock((pthread_mutex_t*)fStorage);
print_pthread_error(status);
SkASSERT(0 == status);
diff --git a/src/ports/SkThread_win.cpp b/src/ports/SkThread_win.cpp
index 5fa58dd803..48c1c9bc5b 100644
--- a/src/ports/SkThread_win.cpp
+++ b/src/ports/SkThread_win.cpp
@@ -10,36 +10,30 @@
#include <windows.h>
#include "SkThread.h"
-int32_t sk_atomic_inc(int32_t* addr)
-{
+int32_t sk_atomic_inc(int32_t* addr) {
// InterlockedIncrement returns the new value, we want to return the old.
return InterlockedIncrement(reinterpret_cast<LONG*>(addr)) - 1;
}
-int32_t sk_atomic_dec(int32_t* addr)
-{
+int32_t sk_atomic_dec(int32_t* addr) {
return InterlockedDecrement(reinterpret_cast<LONG*>(addr)) + 1;
}
-SkMutex::SkMutex(bool /* isGlobal */)
-{
+SkMutex::SkMutex() {
SK_COMPILE_ASSERT(sizeof(fStorage) > sizeof(CRITICAL_SECTION),
NotEnoughSizeForCriticalSection);
InitializeCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage));
}
-SkMutex::~SkMutex()
-{
+SkMutex::~SkMutex() {
DeleteCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage));
}
-void SkMutex::acquire()
-{
+void SkMutex::acquire() {
EnterCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage));
}
-void SkMutex::release()
-{
+void SkMutex::release() {
LeaveCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage));
}