Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: src/utils/SkCondVar.cpp

Issue 371853005: Move threadpool code from include/utils to tools/threadpool. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/utils/SkThreadPool.h ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkCondVar.cpp
diff --git a/src/utils/SkCondVar.cpp b/src/utils/SkCondVar.cpp
deleted file mode 100644
index 5d001c0eddbf14b1cdf4affffd35e33eae47e075..0000000000000000000000000000000000000000
--- a/src/utils/SkCondVar.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkCondVar.h"
-
-SkCondVar::SkCondVar() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_mutex_init(&fMutex, NULL /* default mutex attr */);
- pthread_cond_init(&fCond, NULL /* default cond attr */);
-#elif defined(SK_BUILD_FOR_WIN32)
- InitializeCriticalSection(&fCriticalSection);
- InitializeConditionVariable(&fCondition);
-#endif
-}
-
-SkCondVar::~SkCondVar() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_mutex_destroy(&fMutex);
- pthread_cond_destroy(&fCond);
-#elif defined(SK_BUILD_FOR_WIN32)
- DeleteCriticalSection(&fCriticalSection);
- // No need to clean up fCondition.
-#endif
-}
-
-void SkCondVar::lock() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_mutex_lock(&fMutex);
-#elif defined(SK_BUILD_FOR_WIN32)
- EnterCriticalSection(&fCriticalSection);
-#endif
-}
-
-void SkCondVar::unlock() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_mutex_unlock(&fMutex);
-#elif defined(SK_BUILD_FOR_WIN32)
- LeaveCriticalSection(&fCriticalSection);
-#endif
-}
-
-void SkCondVar::wait() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_cond_wait(&fCond, &fMutex);
-#elif defined(SK_BUILD_FOR_WIN32)
- SleepConditionVariableCS(&fCondition, &fCriticalSection, INFINITE);
-#endif
-}
-
-void SkCondVar::signal() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_cond_signal(&fCond);
-#elif defined(SK_BUILD_FOR_WIN32)
- WakeConditionVariable(&fCondition);
-#endif
-}
-
-void SkCondVar::broadcast() {
-#ifdef SK_USE_POSIX_THREADS
- pthread_cond_broadcast(&fCond);
-#elif defined(SK_BUILD_FOR_WIN32)
- WakeAllConditionVariable(&fCondition);
-#endif
-}
« no previous file with comments | « include/utils/SkThreadPool.h ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698