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

Unified Diff: runtime/bin/eventhandler_macos.cc

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: Add validation and apply in other scenario. 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
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | runtime/platform/signal_blocker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_macos.cc
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index beeae4b50f5bb4240a903b577b52a298fc8b7fdd..eb01d188d3d9d122da45feac0b701d3829d9f8ad 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -179,7 +179,7 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
void EventHandlerImplementation::HandleInterruptFd() {
const intptr_t MAX_MESSAGES = kInterruptMessageSize;
InterruptMessage msg[MAX_MESSAGES];
- ssize_t bytes = TEMP_FAILURE_RETRY(
+ ssize_t bytes = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
read(interrupt_fds_[0], msg, MAX_MESSAGES * kInterruptMessageSize));
for (ssize_t i = 0; i < bytes / kInterruptMessageSize; i++) {
if (msg[i].id == kTimerId) {
@@ -348,6 +348,7 @@ void EventHandlerImplementation::HandleTimeout() {
void EventHandlerImplementation::EventHandlerEntry(uword args) {
+ ThreadSignalBlocker signal_blocker(SIGPROF);
static const intptr_t kMaxEvents = 16;
struct kevent events[kMaxEvents];
EventHandler* handler = reinterpret_cast<EventHandler*>(args);
@@ -368,12 +369,8 @@ void EventHandlerImplementation::EventHandlerEntry(uword args) {
ts.tv_nsec = (millis32 - (secs * 1000)) * 1000000;
timeout = &ts;
}
- intptr_t result = TEMP_FAILURE_RETRY(kevent(handler_impl->kqueue_fd_,
- NULL,
- 0,
- events,
- kMaxEvents,
- timeout));
+ intptr_t result = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
+ kevent(handler_impl->kqueue_fd_, NULL, 0, events, kMaxEvents, timeout));
if (result == -1) {
const int kBufferSize = 1024;
char error_message[kBufferSize];
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | runtime/platform/signal_blocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698