diff options
author | Josh Gao <jmgao@google.com> | 2016-08-12 19:52:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-08-12 19:52:55 +0000 |
commit | 5f2bc28ebf6b6869e16e00d45da835fc63e4dfc5 (patch) | |
tree | 318b60e0cc4e6d98260a87e3ed816ccc89cd752f /debuggerd/utility.cpp | |
parent | 3a197b379924e8590e8dc6da5228f97bccaed3da (diff) | |
parent | f5a960a187ba8959596f6a324c2b5a05c1be9b35 (diff) |
Merge "debuggerd: remove useless timeout from wait_for_signal."
Diffstat (limited to 'debuggerd/utility.cpp')
-rw-r--r-- | debuggerd/utility.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/debuggerd/utility.cpp b/debuggerd/utility.cpp index bd060954e..7fabf690b 100644 --- a/debuggerd/utility.cpp +++ b/debuggerd/utility.cpp @@ -31,9 +31,6 @@ #include <backtrace/Backtrace.h> #include <log/log.h> -constexpr int SLEEP_TIME_USEC = 50000; // 0.05 seconds -constexpr int MAX_TOTAL_SLEEP_USEC = 10000000; // 10 seconds - // Whitelist output desired in the logcat output. bool is_allowed_in_logcat(enum logtype ltype) { if ((ltype == HEADER) @@ -74,10 +71,10 @@ void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { } } -int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { +int wait_for_signal(pid_t tid) { while (true) { int status; - pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL | WNOHANG)); + pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL)); if (n == -1) { ALOGE("waitpid failed: tid %d, %s", tid, strerror(errno)); return -1; @@ -91,14 +88,6 @@ int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { return -1; } } - - if (*total_sleep_time_usec > MAX_TOTAL_SLEEP_USEC) { - ALOGE("timed out waiting for stop signal: tid=%d", tid); - return -1; - } - - usleep(SLEEP_TIME_USEC); - *total_sleep_time_usec += SLEEP_TIME_USEC; } } |