Index: runtime/bin/file_android.cc |
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc |
index b42914967fda54859cbecaa83cbaaf9d40139c90..b4802006ee1e3a16ff361641dfb0b027ce2dec42 100644 |
--- a/runtime/bin/file_android.cc |
+++ b/runtime/bin/file_android.cc |
@@ -17,6 +17,7 @@ |
#include "bin/builtin.h" |
#include "bin/log.h" |
+#include "bin/signal_blocker.h" |
namespace dart { |
@@ -65,12 +66,16 @@ bool File::IsClosed() { |
int64_t File::Read(void* buffer, int64_t num_bytes) { |
ASSERT(handle_->fd() >= 0); |
+ // Block profile interrupts while making I/O call. |
+ ThreadSignalBlocker tsb(SIGPROF); |
return TEMP_FAILURE_RETRY(read(handle_->fd(), buffer, num_bytes)); |
siva
2013/12/13 21:29:14
We should consider moving this blocking stuff into
Cutch
2013/12/13 22:40:18
Not sure how to do that. For now I'm going with Th
|
} |
int64_t File::Write(const void* buffer, int64_t num_bytes) { |
ASSERT(handle_->fd() >= 0); |
+ // Block profile interrupts while making I/O call. |
+ ThreadSignalBlocker tsb(SIGPROF); |
return TEMP_FAILURE_RETRY(write(handle_->fd(), buffer, num_bytes)); |
} |
@@ -247,6 +252,8 @@ bool File::Copy(const char* old_path, const char* new_path) { |
if (result < 0 && (errno == EINVAL || errno == ENOSYS)) { |
const intptr_t kBufferSize = 8 * 1024; |
uint8_t buffer[kBufferSize]; |
+ // Block profile interrupts while making I/O call. |
+ ThreadSignalBlocker tsb(SIGPROF); |
while ((result = TEMP_FAILURE_RETRY( |
read(old_fd, buffer, kBufferSize))) > 0) { |
int wrote = TEMP_FAILURE_RETRY(write(new_fd, buffer, result)); |