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


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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to