[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Running Python scripts from a SIP-wrapped library
From:       Jens Thoms Toerring <jt () toerring ! de>
Date:       2011-07-31 12:42:44
Message-ID: 20110731124244.GA394 () toerring ! de
[Download RAW message or body]

Hi Matt;

On Sat, Jul 30, 2011 at 04:49:07PM -0700, Matt Newell wrote:
> My quick guess is that you should not be calling Py_NewInterpreter, but 
> instead wrap your calls into python code with
> 
> SIP_BLOCK_THREADS
> // Call python functions
> SIP_UNBLOCK_THREADS
> 
> These are just macros for calling PyGILState_Ensure/PyGILState_Release, so you 
> can call them directly if you aren't doing this inside a sip module.
> 
> #define SIP_BLOCK_THREADS   {PyGILState_STATE sipGIL = PyGILState_Ensure();
> #define SIP_UNBLOCK_THREADS PyGILState_Release(sipGIL);}

Thanks really a lot, that did the trick! While I don't feel
that I understand the reasons yet I'm happy enough that it
seems to work now;-)
                      Thanks again and best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt@toerring.de
   \_______________________________      http://toerring.de
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic