[Lldb-commits] [PATCH] D51569: Hold GIL while allocating memory for PythonString.

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Sep 2 09:31:12 PDT 2018


tatyana-krasnukha updated this revision to Diff 163646.
tatyana-krasnukha added a comment.

%feature("nothreadallow") looks more appropriate in this case. GetDescription method is quite cheap, no need to handle the GIL.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51569

Files:
  scripts/Python/python-extensions.swig


Index: scripts/Python/python-extensions.swig
===================================================================
--- scripts/Python/python-extensions.swig
+++ scripts/Python/python-extensions.swig
@@ -1,4 +1,4 @@
-
+%feature("nothreadallow");
 %extend lldb::SBAddress {
         PyObject *lldb::SBAddress::__str__ (){
                 lldb::SBStream description;
@@ -121,6 +121,7 @@
         print >>sb_command_return_object, "something"
         will work correctly */
 
+        %feature("nothreadallow", "");
         void lldb::SBCommandReturnObject::write (const char* str)
         {
             if (str)
@@ -129,6 +130,8 @@
         void lldb::SBCommandReturnObject::flush ()
         {}
 }
+
+%feature("nothreadallow");
 %extend lldb::SBCompileUnit {
         PyObject *lldb::SBCompileUnit::__str__ (){
                 lldb::SBStream description;
@@ -457,6 +460,7 @@
             return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
     %}
 }
+%feature("nothreadallow", "");
 %extend lldb::SBStream {
         /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
         they are meant to make an SBStream into a file-like object so that instructions of the sort
@@ -471,6 +475,7 @@
         void lldb::SBStream::flush ()
         {}
 }
+%feature("nothreadallow");
 %extend lldb::SBSymbol {
         PyObject *lldb::SBSymbol::__str__ (){
                 lldb::SBStream description;
@@ -827,6 +832,7 @@
         }
 }
 
+%feature("nothreadallow", "");
 
 // %extend lldb::SBDebugger {
 //         // FIXME: We can't get the callback and baton


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51569.163646.patch
Type: text/x-patch
Size: 1615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180902/bdb34ef7/attachment.bin>


More information about the lldb-commits mailing list