~ubuntu-branches/ubuntu/oneiric/python2.5/oneiric

« back to all changes in this revision

Viewing changes to Python/pystate.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-12-21 08:57:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081221085749-bijjr25h8na5jdsu
Tags: 2.5.3-0ubuntu1
* New upstream version.
* Regenerate the included documentation.
* Add an option --install-layout=deb, which is ignored for 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
{
241
241
        PyInterpreterState *interp;
242
242
        PyThreadState **p;
 
243
        PyThreadState *prev_p = NULL;
243
244
        if (tstate == NULL)
244
245
                Py_FatalError("PyThreadState_Delete: NULL tstate");
245
246
        interp = tstate->interp;
252
253
                                "PyThreadState_Delete: invalid tstate");
253
254
                if (*p == tstate)
254
255
                        break;
 
256
                /* Sanity check.  These states should never happen but if
 
257
                 * they do we must abort.  Otherwise we'll end up spinning in
 
258
                 * in a tight loop with the lock held.  A similar check is done
 
259
                 * in thread.c find_key().  */
 
260
                if (*p == prev_p)
 
261
                        Py_FatalError(
 
262
                                "PyThreadState_Delete: small circular list(!)"
 
263
                                " and tstate not found.");
 
264
                prev_p = *p;
 
265
                if ((*p)->next == interp->tstate_head)
 
266
                        Py_FatalError(
 
267
                                "PyThreadState_Delete: circular list(!) and"
 
268
                                " tstate not found.");
255
269
        }
256
270
        *p = tstate->next;
257
271
        HEAD_UNLOCK();