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

Unified Diff: runtime/platform/signal_blocker.h

Issue 209333014: Speed up GetRandomBytes by only entering signal-blocking scope once. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« runtime/bin/crypto_macos.cc ('K') | « runtime/bin/crypto_macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/signal_blocker.h
diff --git a/runtime/platform/signal_blocker.h b/runtime/platform/signal_blocker.h
index 4bfc2287a6ed4150fc77ef51cfaee82326e05cfa..356ad3632827f65b8a5267e97b35aeea37295cd6 100644
--- a/runtime/platform/signal_blocker.h
+++ b/runtime/platform/signal_blocker.h
@@ -79,6 +79,18 @@ class ThreadSignalBlocker {
#define VOID_NO_RETRY_EXPECTED(expression) \
(static_cast<void>(NO_RETRY_EXPECTED(expression)))
+// Versions of the above, that does not enter a signal blocking scope. Use only
+// when a signal blocking scope is entered manually.
+#define TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \
Søren Gjesse 2014/03/25 08:21:23 It would be great if this macro could check that a
Anders Johnsen 2014/03/25 13:06:03 I've changed it to validate in debug mode, that it
+ ({ intptr_t __result; \
+ do { \
+ __result = (expression); \
+ } while ((__result == -1L) && (errno == EINTR)); \
+ __result; })
+
+#define VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression) \
+ (static_cast<void>(TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(expression)))
+
} // namespace dart
#endif // PLATFORM_SIGNAL_BLOCKER_H_
« runtime/bin/crypto_macos.cc ('K') | « runtime/bin/crypto_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698