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

Side by Side Diff: chrome/browser/sync/util/compat_pthread.h

Issue 193103: Build sync engine as part of the browser build (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « chrome/browser/sync/util/compat_file_win.cc ('k') | chrome/browser/sync/util/event_sys-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Pthread compatability routines. 5 // Pthread compatability routines.
6 // TODO(timsteele): This file is deprecated. Use PlatformThread.
6 7
7 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_ 8 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
8 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_ 9 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
9 10
10 // TODO(timsteele): This file is deprecated. Use PlatformThread.
11 #include "base/platform_thread.h" 11 #include "base/platform_thread.h"
12 #include "build/build_config.h"
12 13
13 #define ThreadId PlatformThreadId 14 #define ThreadId PlatformThreadId
14 15
15 #ifndef OS_WINDOWS 16 #ifndef OS_WIN
16 inline ThreadId GetCurrentThreadId() { 17 inline ThreadId GetCurrentThreadId() {
17 return PlatformThread::CurrentId(); 18 return PlatformThread::CurrentId();
18 } 19 }
19 #endif // OS_WINDOWS 20 #endif // OS_WIN
20 21
21 #if (!defined(OS_WINDOWS) && !defined(OS_MACOSX)) 22 #if (!defined(OS_WIN) && !defined(OS_MACOSX))
22 // TODO(timsteele): What the heck is this? 23 // TODO(timsteele): What the heck is this?
23 inline int sem_post_multiple(sem_t* sem, int number) { 24 inline int sem_post_multiple(sem_t* sem, int number) {
24 int i; 25 int i;
25 int r = 0; 26 int r = 0;
26 for (i = 0; i < number; i++) { 27 for (i = 0; i < number; i++) {
27 r = sem_post(sem); 28 r = sem_post(sem);
28 if (r != 0) { 29 if (r != 0) {
29 LOG_IF(ERROR, i > 0) << "sem_post() failed on iteration #" << i << 30 LOG_IF(ERROR, i > 0) << "sem_post() failed on iteration #" << i <<
30 " of " << number; 31 " of " << number;
31 return r; 32 return r;
32 } 33 }
33 } 34 }
34 return 0; 35 return 0;
35 } 36 }
36 #endif // (!defined(OS_WINDOWS) && !defined(OS_MACOSX)) 37 #endif // (!defined(OS_WIN) && !defined(OS_MACOSX))
37 38
38 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_ 39 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/compat_file_win.cc ('k') | chrome/browser/sync/util/event_sys-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698