[Python-checkins] python/dist/src/Python pystate.c,2.38,2.38.2.1
gvanrossum at users.sourceforge.net
gvanrossum at users.sourceforge.net
Tue Feb 8 16:01:39 CET 2005
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15462
Modified Files:
Tag: release24-maint
pystate.c
Log Message:
Backport 2.39:
Close the discussion in SF bug 1069160.
Index: pystate.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v
retrieving revision 2.38
retrieving revision 2.38.2.1
diff -u -d -r2.38 -r2.38.2.1
--- pystate.c 8 Nov 2004 04:30:21 -0000 2.38
+++ pystate.c 8 Feb 2005 15:01:35 -0000 2.38.2.1
@@ -320,7 +320,7 @@
/* Asynchronously raise an exception in a thread.
Requested by Just van Rossum and Alex Martelli.
- To prevent naive misuse, you must write your own exception
+ To prevent naive misuse, you must write your own extension
to call this. Must be called with the GIL held.
Returns the number of tstates modified; if it returns a number
greater than one, you're in trouble, and you should call it again
@@ -332,6 +332,7 @@
PyInterpreterState *interp = tstate->interp;
PyThreadState *p;
int count = 0;
+ HEAD_LOCK();
for (p = interp->tstate_head; p != NULL; p = p->next) {
if (p->thread_id != id)
continue;
@@ -340,6 +341,7 @@
p->async_exc = exc;
count += 1;
}
+ HEAD_UNLOCK();
return count;
}
More information about the Python-checkins
mailing list