Add a new SBThread::SafeToCallFunctions API; this calls over to
the SystemRuntime to check if a thread will have any problems
performing an inferior function call so the driver can skip
making that function call on that thread. Often the function
call can be executed on another thread instead.
<rdar://problem/16777874>
llvm-svn: 208732
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
index 40b61fe..46e7666 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -273,6 +273,14 @@
error.Clear();
+ if (thread.SafeToCallFunctions() == false)
+ {
+ if (log)
+ log->Printf ("Not safe to call functions on thread 0x%" PRIx64, thread.GetID());
+ error.SetErrorString ("Not safe to call functions on this thread.");
+ return return_value;
+ }
+
// Set up the arguments for a call to
// struct get_thread_item_info_return_values