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

Unified Diff: runtime/platform/signal_blocker.h

Issue 165723007: Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/platform/signal_blocker.h
diff --git a/runtime/bin/signal_blocker.h b/runtime/platform/signal_blocker.h
similarity index 74%
rename from runtime/bin/signal_blocker.h
rename to runtime/platform/signal_blocker.h
index 2b5fe1e9d8046190f2e82e4394478e5cff1628ed..022622c4e8a84ced765db148c4989cb1abcc9dd1 100644
--- a/runtime/bin/signal_blocker.h
+++ b/runtime/platform/signal_blocker.h
@@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#ifndef BIN_SIGNAL_BLOCKER_H_
-#define BIN_SIGNAL_BLOCKER_H_
+#ifndef PLATFORM_SIGNAL_BLOCKER_H_
+#define PLATFORM_SIGNAL_BLOCKER_H_
#include "platform/globals.h"
@@ -16,7 +16,6 @@
#include "platform/thread.h"
namespace dart {
-namespace bin {
class ThreadSignalBlocker {
public:
@@ -54,7 +53,10 @@ class ThreadSignalBlocker {
};
-#define TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \
+// The definition below is copied from Linux and adapted to avoid lint
+// errors (type long int changed to intptr_t and do/while split on
+// separate lines with body in {}s) and to also block signals.
+#define TEMP_FAILURE_RETRY(expression) \
({ ThreadSignalBlocker tsb(SIGPROF); \
intptr_t __result; \
do { \
@@ -62,10 +64,11 @@ class ThreadSignalBlocker {
} while ((__result == -1L) && (errno == EINTR)); \
__result; })
-#define VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression) \
- (static_cast<void>(TEMP_FAILURE_RETRY_BLOCK_SIGNALS(expression)))
+// This is a version of TEMP_FAILURE_RETRY which does not use the value
+// returned from the expression.
+#define VOID_TEMP_FAILURE_RETRY(expression) \
+ (static_cast<void>(TEMP_FAILURE_RETRY(expression)))
-} // namespace bin
} // namespace dart
-#endif // BIN_SIGNAL_BLOCKER_H_
+#endif // PLATFORM_SIGNAL_BLOCKER_H_
« runtime/bin/dbg_connection_linux.cc ('K') | « runtime/platform/platform_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698