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

Side by Side Diff: runtime/platform/signal_blocker.h

Issue 463993002: - Separate the thread implementation used in bin/ and vm/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef PLATFORM_SIGNAL_BLOCKER_H_ 5 #ifndef PLATFORM_SIGNAL_BLOCKER_H_
6 #define PLATFORM_SIGNAL_BLOCKER_H_ 6 #define PLATFORM_SIGNAL_BLOCKER_H_
7 7
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #if defined(TARGET_OS_WINDOWS) 10 #if defined(TARGET_OS_WINDOWS)
11 #error Do not include this file on Windows. 11 #error Do not include this file on Windows.
12 #endif 12 #endif
13 13
14 #include <signal.h> // NOLINT 14 #include <signal.h> // NOLINT
15 15
16 #include "platform/thread.h"
17
18 namespace dart { 16 namespace dart {
19 17
20 class ThreadSignalBlocker { 18 class ThreadSignalBlocker {
21 public: 19 public:
22 explicit ThreadSignalBlocker(int sig) { 20 explicit ThreadSignalBlocker(int sig) {
23 sigset_t signal_mask; 21 sigset_t signal_mask;
24 sigemptyset(&signal_mask); 22 sigemptyset(&signal_mask);
25 sigaddset(&signal_mask, sig); 23 sigaddset(&signal_mask, sig);
26 // Add sig to signal mask. 24 // Add sig to signal mask.
27 int r = pthread_sigmask(SIG_BLOCK, &signal_mask, &old); 25 int r = pthread_sigmask(SIG_BLOCK, &signal_mask, &old);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 __result = (expression); \ 97 __result = (expression); \
100 } while ((__result == -1L) && (errno == EINTR)); \ 98 } while ((__result == -1L) && (errno == EINTR)); \
101 __result; }) 99 __result; })
102 100
103 #define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \ 101 #define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \
104 (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression))) 102 (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
105 103
106 } // namespace dart 104 } // namespace dart
107 105
108 #endif // PLATFORM_SIGNAL_BLOCKER_H_ 106 #endif // PLATFORM_SIGNAL_BLOCKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698