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

Side by Side Diff: src/core/SkSemaphore.cpp

Issue 2041943002: SkLeanWindows.h: #include "Windows.h" fewer places (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-06-06 (Monday) 13:54:33 EDT Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "../private/SkSemaphore.h" 8 #include "../private/SkSemaphore.h"
9 #include "../private/SkLeanWindows.h"
bungeman-skia 2016/06/06 18:11:59 nit: up one line
hal.canary 2016/06/06 18:22:32 Done.
9 10
10 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) 11 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
11 #include <mach/mach.h> 12 #include <mach/mach.h>
12 struct SkBaseSemaphore::OSSemaphore { 13 struct SkBaseSemaphore::OSSemaphore {
13 semaphore_t fSemaphore; 14 semaphore_t fSemaphore;
14 15
15 OSSemaphore() { 16 OSSemaphore() {
16 semaphore_create(mach_task_self(), &fSemaphore, SYNC_POLICY_LIFO, 0/ *initial count*/); 17 semaphore_create(mach_task_self(), &fSemaphore, SYNC_POLICY_LIFO, 0/ *initial count*/);
17 } 18 }
18 ~OSSemaphore() { semaphore_destroy(mach_task_self(), fSemaphore); } 19 ~OSSemaphore() { semaphore_destroy(mach_task_self(), fSemaphore); }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 64 }
64 65
65 void SkBaseSemaphore::osWait() { 66 void SkBaseSemaphore::osWait() {
66 fOSSemaphoreOnce([this] { fOSSemaphore = new OSSemaphore; }); 67 fOSSemaphoreOnce([this] { fOSSemaphore = new OSSemaphore; });
67 fOSSemaphore->wait(); 68 fOSSemaphore->wait();
68 } 69 }
69 70
70 void SkBaseSemaphore::cleanup() { 71 void SkBaseSemaphore::cleanup() {
71 delete fOSSemaphore; 72 delete fOSSemaphore;
72 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698