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

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

Issue 253413002: Make opendir test for EINTR again and make NO_RETRY_EXPECTED check in release mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « runtime/bin/directory_macos.cc ('k') | no next file » | 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) 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)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // This is a version of TEMP_FAILURE_RETRY which does not use the value 67 // This is a version of TEMP_FAILURE_RETRY which does not use the value
68 // returned from the expression. 68 // returned from the expression.
69 #define VOID_TEMP_FAILURE_RETRY(expression) \ 69 #define VOID_TEMP_FAILURE_RETRY(expression) \
70 (static_cast<void>(TEMP_FAILURE_RETRY(expression))) 70 (static_cast<void>(TEMP_FAILURE_RETRY(expression)))
71 71
72 // This macro can be used to insert checks that a call is made, that 72 // This macro can be used to insert checks that a call is made, that
73 // was expected to not return EINTR, but did it anyway. 73 // was expected to not return EINTR, but did it anyway.
74 #define NO_RETRY_EXPECTED(expression) \ 74 #define NO_RETRY_EXPECTED(expression) \
75 ({ intptr_t __result = (expression); \ 75 ({ intptr_t __result = (expression); \
76 ASSERT(__result != -1L || errno != EINTR); \ 76 if (__result == -1L && errno == EINTR) { \
77 FATAL("Unexpected EINTR errno"); \
78 } \
77 __result; }) 79 __result; })
78 80
79 #define VOID_NO_RETRY_EXPECTED(expression) \ 81 #define VOID_NO_RETRY_EXPECTED(expression) \
80 (static_cast<void>(NO_RETRY_EXPECTED(expression))) 82 (static_cast<void>(NO_RETRY_EXPECTED(expression)))
81 83
82 // Define to check in debug mode, if a signal is currently being blocked. 84 // Define to check in debug mode, if a signal is currently being blocked.
83 #define CHECK_IS_BLOCKING(signal) \ 85 #define CHECK_IS_BLOCKING(signal) \
84 ({ sigset_t signal_mask; \ 86 ({ sigset_t signal_mask; \
85 int __r = pthread_sigmask(SIG_BLOCK, NULL, &signal_mask); \ 87 int __r = pthread_sigmask(SIG_BLOCK, NULL, &signal_mask); \
86 USE(__r); \ 88 USE(__r); \
(...skipping 10 matching lines...) Expand all
97 __result = (expression); \ 99 __result = (expression); \
98 } while ((__result == -1L) && (errno == EINTR)); \ 100 } while ((__result == -1L) && (errno == EINTR)); \
99 __result; }) 101 __result; })
100 102
101 #define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \ 103 #define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \
102 (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression))) 104 (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
103 105
104 } // namespace dart 106 } // namespace dart
105 107
106 #endif // PLATFORM_SIGNAL_BLOCKER_H_ 108 #endif // PLATFORM_SIGNAL_BLOCKER_H_
OLDNEW
« no previous file with comments | « runtime/bin/directory_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698