OLD | NEW |
---|---|
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 BIN_SIGNAL_BLOCKER_H_ | 5 #ifndef BIN_SIGNAL_BLOCKER_H_ |
6 #define BIN_SIGNAL_BLOCKER_H_ | 6 #define BIN_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 ASSERT(r == 0); | 49 ASSERT(r == 0); |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
53 sigset_t old; | 53 sigset_t old; |
54 }; | 54 }; |
55 | 55 |
56 | 56 |
57 #define TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \ | 57 #define TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \ |
58 ({ ThreadSignalBlocker tsb(SIGPROF); \ | 58 ({ ThreadSignalBlocker tsb(SIGPROF); \ |
59 int64_t __result; \ | 59 intptr_t __result; \ |
60 do { \ | 60 do { \ |
61 __result = static_cast<int64_t>(expression); \ | 61 __result = (expression); \ |
62 } while (__result == -1L && errno == EINTR); \ | 62 } while ((__result == -1L) && (errno == EINTR)); \ |
63 __result; }) | 63 __result; }) |
64 | 64 |
65 #define VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \ | 65 #define VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \ |
66 (static_cast<void>(TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression))) | 66 (static_cast<void>(TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression))) |
siva
2014/02/19 00:34:04
Maybe in another CL we should consider co locating
Ivan Posva
2014/02/19 04:04:23
I don't think we need both versions. Different CL.
| |
67 | 67 |
68 } // namespace bin | 68 } // namespace bin |
69 } // namespace dart | 69 } // namespace dart |
70 | 70 |
71 #endif // BIN_SIGNAL_BLOCKER_H_ | 71 #endif // BIN_SIGNAL_BLOCKER_H_ |
OLD | NEW |