Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
CEnterLeavePython Class Reference

#include <PyXPCOM.h>

List of all members.

Public Member Functions

 CEnterLeavePython ()
 ~CEnterLeavePython ()

Private Attributes

PRBool created

Detailed Description

Definition at line 614 of file PyXPCOM.h.


Constructor & Destructor Documentation

Definition at line 616 of file PyXPCOM.h.

                           {
              created = PyXPCOM_ThreadState_Ensure();
              PyXPCOM_InterpreterLock_Acquire();
              if (created) {
                     // If pending python calls are waiting as we enter Python,
                     // it will generally mean an asynch signal handler, etc.
                     // We can either call it here, or wait for Python to call it
                     // as part of its "even 'n' opcodes" check.  If we wait for
                     // Python to check it and the pending call raises an exception,
                     // then it is _our_ code that will fail - this is unfair,
                     // as the signal was raised before we were entered - indeed,
                     // we may be directly responding to the signal!
                     // Thus, we flush all the pending calls here, and report any
                     // exceptions via our normal exception reporting mechanism.
                     // We can then execute our code in the knowledge that only
                     // signals raised _while_ we are executing will cause exceptions.
                     PyXPCOM_MakePendingCalls();
              }
       }

Here is the call graph for this function:

Definition at line 635 of file PyXPCOM.h.

                            {
       // The interpreter state must be cleared
       // _before_ we release the lock, as some of
       // the sys. attributes cleared (eg, the current exception)
       // may need the lock to invoke their destructors - 
       // specifically, when exc_value is a class instance, and
       // the exception holds the last reference!
              if ( created )
                     PyXPCOM_ThreadState_Clear();
              PyXPCOM_InterpreterLock_Release();
              if ( created )
                     PyXPCOM_ThreadState_Free();
       }

Here is the call graph for this function:


Member Data Documentation

Definition at line 649 of file PyXPCOM.h.


The documentation for this class was generated from the following file: