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

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

Issue 1213063011: Don't cap num_cores at 32 on 32-bit Windows. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkOnce.h" 8 #include "SkOnce.h"
9 #include "SkRunnable.h" 9 #include "SkRunnable.h"
10 #include "SkSemaphore.h" 10 #include "SkSemaphore.h"
11 #include "SkSpinlock.h" 11 #include "SkSpinlock.h"
12 #include "SkTDArray.h" 12 #include "SkTDArray.h"
13 #include "SkTaskGroup.h" 13 #include "SkTaskGroup.h"
14 #include "SkThreadUtils.h" 14 #include "SkThreadUtils.h"
15 15
16 #if defined(SK_BUILD_FOR_WIN32) 16 #if defined(SK_BUILD_FOR_WIN32)
17 static void query_num_cores(int* num_cores) { 17 static void query_num_cores(int* num_cores) {
18 SYSTEM_INFO sysinfo; 18 SYSTEM_INFO sysinfo;
19 GetSystemInfo(&sysinfo); 19 GetNativeSystemInfo(&sysinfo);
20 *num_cores = sysinfo.dwNumberOfProcessors; 20 *num_cores = sysinfo.dwNumberOfProcessors;
21 } 21 }
22 #else 22 #else
23 #include <unistd.h> 23 #include <unistd.h>
24 static void query_num_cores(int* num_cores) { 24 static void query_num_cores(int* num_cores) {
25 *num_cores = (int)sysconf(_SC_NPROCESSORS_ONLN); 25 *num_cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
26 } 26 }
27 #endif 27 #endif
28 28
29 // We cache sk_num_cores() so we only query the OS once. 29 // We cache sk_num_cores() so we only query the OS once.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 SkTaskGroup::SkTaskGroup() : fPending(0) {} 215 SkTaskGroup::SkTaskGroup() : fPending(0) {}
216 216
217 void SkTaskGroup::wait() { ThreadPool::Wait(&fPending ); } 217 void SkTaskGroup::wait() { ThreadPool::Wait(&fPending ); }
218 void SkTaskGroup::add(SkRunnable* task) { ThreadPool::Add(task, &fPe nding); } 218 void SkTaskGroup::add(SkRunnable* task) { ThreadPool::Add(task, &fPe nding); }
219 void SkTaskGroup::add(void (*fn)(void*), void* arg) { ThreadPool::Add(fn, arg, & fPending); } 219 void SkTaskGroup::add(void (*fn)(void*), void* arg) { ThreadPool::Add(fn, arg, & fPending); }
220 void SkTaskGroup::batch (void (*fn)(void*), void* args, int N, size_t stride) { 220 void SkTaskGroup::batch (void (*fn)(void*), void* args, int N, size_t stride) {
221 ThreadPool::Batch(fn, args, N, stride, &fPending); 221 ThreadPool::Batch(fn, args, N, stride, &fPending);
222 } 222 }
223 223
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698