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

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

Issue 19808007: Split atomic and mutex implementations and make inlinable. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Address dependency comments. Created 7 years 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/SkMutex_win.h ('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
(Empty)
1 /*
2 * Copyright 2006 The Android Open Source Project
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 "SkThread.h"
9
10 int32_t sk_atomic_inc(int32_t* addr) {
11 int32_t value = *addr;
12 *addr = value + 1;
13 return value;
14 }
15
16 int32_t sk_atomic_add(int32_t* addr, int32_t inc) {
17 int32_t value = *addr;
18 *addr = value + inc;
19 return value;
20 }
21
22 int32_t sk_atomic_dec(int32_t* addr) {
23 int32_t value = *addr;
24 *addr = value - 1;
25 return value;
26 }
27 void sk_membar_aquire__after_atomic_dec() { }
28
29 int32_t sk_atomic_conditional_inc(int32_t* addr) {
30 int32_t value = *addr;
31 if (value != 0) ++*addr;
32 return value;
33 }
34 void sk_membar_aquire__after_atomic_conditional_inc() { }
35
36 SkMutex::SkMutex() {}
37
38 SkMutex::~SkMutex() {}
39
40 #ifndef SK_USE_POSIX_THREADS
41 void SkMutex::acquire() {}
42 void SkMutex::release() {}
43 #endif
OLDNEW
« no previous file with comments | « src/ports/SkMutex_win.h ('k') | src/ports/SkThread_pthread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698