[Patches] [ python-Patches-684256 ] AutoThreadState implementation

SourceForge.net noreply@sourceforge.net
Fri, 18 Apr 2003 18:47:41 -0700


Patches item #684256, was opened at 2003-02-11 10:02
Message generated for change (Comment added) made by mhammond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=684256&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: AutoThreadState implementation

Initial Comment:
An implementation of the AutoThreadState API, mainly
for discussion purposes at this point.  To be a PEP soon.

----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2003-04-19 11:47

Message:
Logged In: YES 
user_id=14198

Attaching a new patch.  This corrects the clearing of the
threadstate, and uses the new names PyGILState_*.

----------------------------------------------------------------------

Comment By: Greg Chapman (glchapman)
Date: 2003-03-05 04:44

Message:
Logged In: YES 
user_id=86307

It appears to me that PyAutoThreadState_Release calls 
PyThreadState_Clear after releasing the GIL (if the thread 
state was created by PyAutoThreadState_Ensure, then old 
state will be UNLOCKED, so PyEval_ReleaseThread will be 
called).  It looks to me that, if the thread state is going to be 
deleted, the call to Clear it should be moved up to just before 
ReleaseThread, i.e.:

if (oldstate == PyAutoThreadState_UNLOCKED) {
    if (tcur->autothreadstate_counter == 1)
        PyThreadState_Clear(tcur);
    PyEval_ReleaseThread(tcur);
}



----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2003-02-14 00:05

Message:
Logged In: YES 
user_id=14198

Attaching a new patch that works perfectly.  2 checks remain
in the code that will be debug only, but apart from that, it
is pretty good.  No changes at all to existing semantics.

Tested on Linux and Windows.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=684256&group_id=5470