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

Unified Diff: tools/android/forwarder2/pipe_notifier.cc

Issue 148113003: forwarder2: Make the Forwarder instances operate on a single thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address David's comment Created 6 years, 11 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 | « tools/android/forwarder2/pipe_notifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/pipe_notifier.cc
diff --git a/tools/android/forwarder2/pipe_notifier.cc b/tools/android/forwarder2/pipe_notifier.cc
index 9110fffcea1812dd1df8a648a1556fb408af4478..02842bd9b7cea1e9829b0a829268fb67990139aa 100644
--- a/tools/android/forwarder2/pipe_notifier.cc
+++ b/tools/android/forwarder2/pipe_notifier.cc
@@ -34,10 +34,21 @@ bool PipeNotifier::Notify() {
errno = 0;
int ret = HANDLE_EINTR(write(sender_fd_, "1", 1));
if (ret < 0) {
- LOG(WARNING) << "Error while notifying pipe. " << safe_strerror(errno);
+ PLOG(ERROR) << "write";
return false;
}
return true;
}
+void PipeNotifier::Reset() {
+ char c;
+ int ret = HANDLE_EINTR(read(receiver_fd_, &c, 1));
+ if (ret < 0) {
+ PLOG(ERROR) << "read";
+ return;
+ }
+ DCHECK_EQ(1, ret);
+ DCHECK_EQ('1', c);
+}
+
} // namespace forwarder
« no previous file with comments | « tools/android/forwarder2/pipe_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698