diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 20:03:03 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 20:03:03 +0000 |
commit | a4fc8d30896e63e7074ac06dbd7b13b00732f3c0 (patch) | |
tree | dafaca3fb8892930dce03ee8a6a7d266b46be18f /skia/ports/SkThread_pthread.cpp | |
parent | 6131db47e71532f62aae3badcd34a82a64cb9f2a (diff) | |
download | chromium_src-a4fc8d30896e63e7074ac06dbd7b13b00732f3c0.zip chromium_src-a4fc8d30896e63e7074ac06dbd7b13b00732f3c0.tar.gz chromium_src-a4fc8d30896e63e7074ac06dbd7b13b00732f3c0.tar.bz2 |
Remove the remainder of the skia source code from the Chromium repo. It now lives over in third_party/skia (I only removed the headers in the first CL, since it was too unwieldy with all these deletes).
BUG=none
TEST=If it builds, you're happy.
R=dglazkov
Review URL: http://codereview.chromium.org/113827
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ports/SkThread_pthread.cpp')
-rw-r--r-- | skia/ports/SkThread_pthread.cpp | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/skia/ports/SkThread_pthread.cpp b/skia/ports/SkThread_pthread.cpp deleted file mode 100644 index 4ee857d..0000000 --- a/skia/ports/SkThread_pthread.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "SkThread.h" - -#include <pthread.h> -#include <errno.h> - -SkMutex gAtomicMutex; - -int32_t sk_atomic_inc(int32_t* addr) -{ - SkAutoMutexAcquire ac(gAtomicMutex); - - int32_t value = *addr; - *addr = value + 1; - return value; -} - -int32_t sk_atomic_dec(int32_t* addr) -{ - SkAutoMutexAcquire ac(gAtomicMutex); - - int32_t value = *addr; - *addr = value - 1; - return value; -} - -////////////////////////////////////////////////////////////////////////////// - -static void print_pthread_error(int status) -{ - switch (status) { - case 0: // success - break; - case EINVAL: - printf("pthread error [%d] EINVAL\n", status); - break; - case EBUSY: - printf("pthread error [%d] EBUSY\n", status); - break; - default: - printf("pthread error [%d] unknown\n", status); - break; - } -} - -SkMutex::SkMutex(bool isGlobal) : fIsGlobal(isGlobal) -{ - if (sizeof(pthread_mutex_t) > sizeof(fStorage)) - { - SkDEBUGF(("pthread mutex size = %d\n", sizeof(pthread_mutex_t))); - SkASSERT(!"mutex storage is too small"); - } - - int status; - pthread_mutexattr_t attr; - - status = pthread_mutexattr_init(&attr); - print_pthread_error(status); - SkASSERT(0 == status); - - status = pthread_mutex_init((pthread_mutex_t*)fStorage, &attr); - print_pthread_error(status); - SkASSERT(0 == status); -} - -SkMutex::~SkMutex() -{ - int status = pthread_mutex_destroy((pthread_mutex_t*)fStorage); - - // only report errors on non-global mutexes - if (!fIsGlobal) - { - print_pthread_error(status); - SkASSERT(0 == status); - } -} - -void SkMutex::acquire() -{ - int status = pthread_mutex_lock((pthread_mutex_t*)fStorage); - print_pthread_error(status); - SkASSERT(0 == status); -} - -void SkMutex::release() -{ - int status = pthread_mutex_unlock((pthread_mutex_t*)fStorage); - print_pthread_error(status); - SkASSERT(0 == status); -} - |