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

Side by Side Diff: xz/src/common/mythread.h

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 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 | « xz/src/common/common_w32res.rc ('k') | xz/src/common/sysdefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file mythread.h
4 /// \brief Wrappers for threads
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #include "sysdefs.h"
14
15
16 #ifdef HAVE_PTHREAD
17 # include <pthread.h>
18
19 # define mythread_once(func) \
20 do { \
21 static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
22 pthread_once(&once_, &func); \
23 } while (0)
24
25 # define mythread_sigmask(how, set, oset) \
26 pthread_sigmask(how, set, oset)
27
28 #else
29
30 # define mythread_once(func) \
31 do { \
32 static bool once_ = false; \
33 if (!once_) { \
34 func(); \
35 once_ = true; \
36 } \
37 } while (0)
38
39 # define mythread_sigmask(how, set, oset) \
40 sigprocmask(how, set, oset)
41
42 #endif
OLDNEW
« no previous file with comments | « xz/src/common/common_w32res.rc ('k') | xz/src/common/sysdefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698