summaryrefslogtreecommitdiff
path: root/lldb/tools/debugserver/source/RNBRemote.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-07-24 01:36:24 +0000
committerJason Molenda <jmolenda@apple.com>2014-07-24 01:36:24 +0000
commit36a216eefc8c1d46bc6704cd355d55abbea33c41 (patch)
tree2b16c8c5227111fbbe53742cb110d0301f5818ea /lldb/tools/debugserver/source/RNBRemote.cpp
parent451f30e89f882e796cbba744fc4f340b7ddbf43f (diff)
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/RNBRemote.cpp')
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index c731fbea02b7..aa5bcd130f69 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -20,6 +20,11 @@
#include <sys/stat.h>
#include <sys/sysctl.h>
+#if defined (__APPLE__)
+#include <pthread.h>
+#include <sched.h>
+#endif
+
#include "DNB.h"
#include "DNBDataRef.h"
#include "DNBLog.h"
@@ -755,6 +760,20 @@ RNBRemote::ThreadFunctionReadRemoteData(void *arg)
RNBRemoteSP remoteSP(g_remoteSP);
if (remoteSP.get() != NULL)
{
+
+#if defined (__APPLE__)
+ pthread_setname_np ("read gdb-remote packets 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
+
RNBRemote* remote = remoteSP.get();
PThreadEvent& events = remote->Context().Events();
events.SetEvents (RNBContext::event_read_thread_running);