aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSemaphore.cpp
Commit message (Collapse)AuthorAge
* eliminate SK_BUILD_FOR_WIN32Gravatar Mike Klein2018-01-26
| | | | | | | | | | SK_BUILD_FOR_WIN and SK_BUILD_FOR_WIN32 have long meant the same thing. Chrome fix is https://chromium-review.googlesource.com/c/chromium/src/+/884007 Change-Id: I0e907b1bcd2a358eabf776f414fd3aeb3c689561 Reviewed-on: https://skia-review.googlesource.com/99340 Reviewed-by: Mike Reed <reed@google.com>
* Teach TSAN directly about semaphore_t.Gravatar Mike Klein2017-09-21
| | | | | | | | | | | | | | | Instead of teaching TSAN than SkMutex is a lock to get around it not understanding Mach semaphore_t routines, teach it that there is a happens-before relationship between semaphore_signal() and semaphore_wait(). This reverts commit e395bf2d189e22822ddf2b46541c510d6d8fbcc0. New changes are entirely restricted to SkSemaphore.cpp. Change-Id: I27f647b93c48e81e8327db849881d669c4cd3d04 Reviewed-on: https://skia-review.googlesource.com/49180 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkExecutorGravatar Mike Klein2017-02-22
| | | | | | | | | | | | | | | | | | Refactoring to refamiliarize myself with SkTaskGroup and SkThreadPool. This adds an SkExecutor interface to describe how we use SkThreadPool, with a global setter and getter for a default instance. Then I rewrote SkTaskGroup to work with any executor, the global default by default. I also think I've made the SkTaskGroup::wait() borrow logic clearer with the addition of SkSemaphore::try_wait(). This lets me keep the semaphore count and actual count of work in perfect sync. Change-Id: I6bbdfaeb0e2c3a43daff6192d34bc4a3f7210178 Reviewed-on: https://skia-review.googlesource.com/8836 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkLeanWindows.h: #include "Windows.h" fewer placesGravatar halcanary2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | $ git grep -l '<windows.h>' include src include/private/SkLeanWindows.h $ git grep -l SkLeanWindows.h | grep '\.h$' include/ports/SkTypeface_win.h include/utils/win/SkHRESULT.h include/utils/win/SkTScopedComPtr.h include/views/SkEvent.h src/core/SkMathPriv.h src/ports/SkTypeface_win_dw.h src/utils/SkThreadUtils_win.h src/utils/win/SkWGL.h The same for `#include <intrin.h>` that was found in SkMath.h. Those functions that needed it are moved to SkMathPriv.h. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041943002 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng Review-Url: https://codereview.chromium.org/2041943002
* Modernize SkMutex and SkSemaphore.Gravatar mtklein2016-05-05
| | | | | | | | | | | | | | | | | | | | | - use <atomic> - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea Review-Url: https://codereview.chromium.org/1947153002
* Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of ↵Gravatar sclittle2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1947153002/ ) Reason for revert: This CL seems to have broken the Linux x64 and Mac bots, e.g. https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 https://build.chromium.org/p/chromium/builders/Mac/builds/15151 The error appears to have something to do with new static initializers being added. Original issue's description: > Modernize SkMutex and SkSemaphore. > > - use <atomic> > - fuse SkMutex and SkBaseMutex > - fuse SkSemaphore and SkBaseSemaphore > > Still TODO: > - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name > > I just didn't want to bother fixing all that up until I know this CL sticks. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=609340 Review-Url: https://codereview.chromium.org/1945343003
* Modernize SkMutex and SkSemaphore.Gravatar mtklein2016-05-04
| | | | | | | | | | | | | | | | | | | - use <atomic> - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Review-Url: https://codereview.chromium.org/1947153002
* Make mutex semaphore based.Gravatar herb2015-09-24
| | | | | | | | | | | | This implementation improves performance of SkMutex acquire / release pair from 42ns -> 13 ns. SkSharedMutex and SkSpinlock have the same performance. It also removes specialized windows and linux/mac code. BUG=skia: Review URL: https://codereview.chromium.org/1359733002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* SkSemaphore: use SYNC_POLICY_LIFO on Mach.Gravatar mtklein2015-06-17
| | | | | | | | | | | | | | | Turns out _LIFO does work as we expected, keeping N < M threads active when we have M live threads but only N units of work to do at a time. Also as we expected _FIFO does round-robin through the threads. Performance doesn't seem to be affected, but let's do it anyway. If nothing else this makes profiles a little easier to read. I don't see POSIX or Windows equivalents. BUG=skia: Review URL: https://codereview.chromium.org/1192433006
* Add and use SkSemaphoreGravatar mtklein2015-06-17
This allows a faster implementation of our SkTaskGroup thread pool. It also means we don't need SkCondVar (which, remember, isn't supported on XP.) Doing some testing with SampleApp, this really cuts down on the overhead from SkTaskGroup, e.g. 30% to 10%. BUG=skia: Review URL: https://codereview.chromium.org/1192573003