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

Side by Side Diff: src/ports/SkThread_none.cpp

Issue 19240007: Split TLS implementation into its own translation unit. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Explicitly set static initializers used before explicit assignment. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/ports/SkTLS_win.cpp ('k') | src/ports/SkThread_pthread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10 #include "SkThread.h" 8 #include "SkThread.h"
11 #include "SkTLS.h"
12 9
13 int32_t sk_atomic_inc(int32_t* addr) { 10 int32_t sk_atomic_inc(int32_t* addr) {
14 int32_t value = *addr; 11 int32_t value = *addr;
15 *addr = value + 1; 12 *addr = value + 1;
16 return value; 13 return value;
17 } 14 }
18 15
19 int32_t sk_atomic_add(int32_t* addr, int32_t inc) { 16 int32_t sk_atomic_add(int32_t* addr, int32_t inc) {
20 int32_t value = *addr; 17 int32_t value = *addr;
21 *addr = value + inc; 18 *addr = value + inc;
(...skipping 15 matching lines...) Expand all
37 void sk_membar_aquire__after_atomic_conditional_inc() { } 34 void sk_membar_aquire__after_atomic_conditional_inc() { }
38 35
39 SkMutex::SkMutex() {} 36 SkMutex::SkMutex() {}
40 37
41 SkMutex::~SkMutex() {} 38 SkMutex::~SkMutex() {}
42 39
43 #ifndef SK_USE_POSIX_THREADS 40 #ifndef SK_USE_POSIX_THREADS
44 void SkMutex::acquire() {} 41 void SkMutex::acquire() {}
45 void SkMutex::release() {} 42 void SkMutex::release() {}
46 #endif 43 #endif
47
48 //////////////////////////////////////////////////////////////////////////
49
50 static void* gSpecific;
51
52 void* SkTLS::PlatformGetSpecific(bool) {
53 return gSpecific;
54 }
55
56 void SkTLS::PlatformSetSpecific(void* ptr) {
57 gSpecific = ptr;
58 }
OLDNEW
« no previous file with comments | « src/ports/SkTLS_win.cpp ('k') | src/ports/SkThread_pthread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698