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

Side by Side Diff: src/utils/SkThreadUtils_pthread_mach.cpp

Issue 1408213005: Remove SkThread::setProcessorAffinity() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gAdds Created 5 years, 2 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 | « src/utils/SkThreadUtils_pthread_linux.cpp ('k') | src/utils/SkThreadUtils_pthread_other.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkThreadUtils.h"
9 #include "SkThreadUtils_pthread.h"
10
11 #include <mach/mach.h>
12 #include <mach/thread_policy.h>
13 #include <pthread.h>
14
15 bool SkThread::setProcessorAffinity(unsigned int processor) {
16 SkThread_PThreadData* pthreadData = static_cast<SkThread_PThreadData*>(fData );
17 if (!pthreadData->fValidPThread) {
18 return false;
19 }
20
21 mach_port_t tid = pthread_mach_thread_np(pthreadData->fPThread);
22
23 thread_affinity_policy_data_t policy;
24 policy.affinity_tag = processor;
25
26 return 0 == thread_policy_set(tid,
27 THREAD_AFFINITY_POLICY,
28 (thread_policy_t) &policy,
29 THREAD_AFFINITY_POLICY_COUNT);
30 }
OLDNEW
« no previous file with comments | « src/utils/SkThreadUtils_pthread_linux.cpp ('k') | src/utils/SkThreadUtils_pthread_other.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698