diff options
author | Jason Molenda <jmolenda@apple.com> | 2014-07-24 01:36:24 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2014-07-24 01:36:24 +0000 |
commit | 36a216eefc8c1d46bc6704cd355d55abbea33c41 (patch) | |
tree | 2b16c8c5227111fbbe53742cb110d0301f5818ea /lldb/tools/debugserver/source/RNBContext.cpp | |
parent | 451f30e89f882e796cbba744fc4f340b7ddbf43f (diff) | |
download | bcm5719-llvm-36a216eefc8c1d46bc6704cd355d55abbea33c41.tar.gz bcm5719-llvm-36a216eefc8c1d46bc6704cd355d55abbea33c41.zip |
Increase the gdb-remote packet timeout for the first packet we send
to the remote side (QStartNoAckMode) - it may take a little longer
than normal to get a reply.
In debugserver, hardcode the priority for several threads so they
aren't de-prioritized when a user app is using system resources.
Also, set the names of the threads.
<rdar://problem/17509866>
llvm-svn: 213828
Diffstat (limited to 'lldb/tools/debugserver/source/RNBContext.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/RNBContext.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBContext.cpp b/lldb/tools/debugserver/source/RNBContext.cpp index b9189df9d1c..960d6d99c9d 100644 --- a/lldb/tools/debugserver/source/RNBContext.cpp +++ b/lldb/tools/debugserver/source/RNBContext.cpp @@ -16,6 +16,11 @@ #include <sys/stat.h> #include <sstream> +#if defined (__APPLE__) +#include <pthread.h> +#include <sched.h> +#endif + #include "RNBRemote.h" #include "DNB.h" #include "DNBLog.h" @@ -145,6 +150,20 @@ RNBContext::ThreadFunctionProcessStatus(void *arg) nub_process_t pid = ctx.ProcessID(); DNBLogThreadedIf(LOG_RNB_PROC, "RNBContext::%s (arg=%p, pid=%4.4x): thread starting...", __FUNCTION__, arg, pid); ctx.Events().SetEvents (RNBContext::event_proc_thread_running); + +#if defined (__APPLE__) + pthread_setname_np ("child process status watcher thread"); +#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) + struct sched_param thread_param; + int thread_sched_policy; + if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0) + { + thread_param.sched_priority = 47; + pthread_setschedparam(pthread_self(), thread_sched_policy, &thread_param); + } +#endif +#endif + bool done = false; while (!done) { |