summaryrefslogtreecommitdiffstats
path: root/Include/pystate.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30860: Fix a refleak. (#3567)Eric Snow2017-09-141-2/+0
| | | | | Resolves bpo-31420. (This was accidentally reverted when in #3565.)
* bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)Eric Snow2017-09-141-0/+3
| | | PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
* bpo-30860: Fix a refleak. (#3506)Eric Snow2017-09-121-2/+0
| | | | | | | | | | | | | | * Drop warnoptions from PyInterpreterState. * Drop xoptions from PyInterpreterState. * Don't set warnoptions and _xoptions again. * Decref after adding to sys.__dict__. * Drop an unused macro. * Check sys.xoptions *before* we delete it.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-14/+16
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-1/+6
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-4/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-061-16/+14
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-061-14/+16
| | | | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)Eric Snow2017-09-041-1/+0
| | | sys.modules is the one true source.
* bpo-30604: clean up co_extra support (#2144)Dino Viehland2017-06-211-3/+4
| | | bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-0/+5
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)Eric Snow2017-05-241-0/+13
| | | (patch by Nick Coghlan)
* bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)Eric Snow2017-05-241-0/+11
| | | (patch by Nick Coghlan)
* bpo-22257: Small changes for PEP 432. (#1728)Eric Snow2017-05-231-0/+1
| | | PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
* bpo-29102: Add a unique ID to PyInterpreterState. (#1639)Eric Snow2017-05-231-0/+9
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-2/+2
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #26900: Excluded underscored names and other private API from limited API.Serhiy Storchaka2016-09-111-0/+10
|
* remove ceval timestamp supportBenjamin Peterson2016-09-091-3/+0
|
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-091-0/+3
|
* Add the co_extra field and accompanying APIs to code objects.Brett Cannon2016-09-071-0/+7
| | | | This completes PEP 523.
* Implement the frame evaluation API aspect of PEP 523.Brett Cannon2016-09-051-2/+5
|
* Issue #22557: Now importing already imported modules is up to 2.5 times faster.Serhiy Storchaka2016-08-021-0/+1
|
* Merge 3.5 (pystate.h)Victor Stinner2016-03-251-2/+0
|\
| * pystate.h: fix _PyThreadState_UncheckedGet()Victor Stinner2016-03-241-2/+0
| | | | | | | | Declare the function even if thread support is disabled.
* | faulthandler now works in non-Python threadsVictor Stinner2016-03-161-4/+12
| | | | | | | | | | | | | | | | | | | | | | Issue #26563: * Add _PyGILState_GetInterpreterStateUnsafe() function: the single PyInterpreterState used by this process' GILState implementation. * Enhance _Py_DumpTracebackThreads() to retrieve the interpreter state from autoInterpreterState in last resort. The function now accepts NULL for interp and current_tstate parameters. * test_faulthandler: fix a ResourceWarning when test is interrupted by CTRL+c
* | Add more checks on the GILVictor Stinner2016-03-141-0/+4
|/ | | | | | | | | | | | Issue #10915, #15751, #26558: * PyGILState_Check() now returns 1 (success) before the creation of the GIL and after the destruction of the GIL. It allows to use the function early in Python initialization and late in Python finalization. * Add a flag to disable PyGILState_Check(). Disable PyGILState_Check() when Py_NewInterpreter() is called * Add assert(PyGILState_Check()) to: _Py_dup(), _Py_fstat(), _Py_read() and _Py_write()
* Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-0/+10
| | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* Issue #25150: Hide the private _Py_atomic_xxx symbols from the publicVictor Stinner2015-09-181-12/+5
| | | | | | | | | Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies. It is important that the _PyThreadState_Current variable is always accessed with the same implementation of pyatomic.h. Use the PyThreadState_Get() function so extension modules will all reuse the same implementation.
* Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefullyYury Selivanov2015-06-021-0/+1
|
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-0/+2
|
* Issue #23644: Fix issues with C++ when compiling Python extensionsVictor Stinner2015-03-171-3/+7
| | | | | | | | Disable completly pyatomic.h on C++, because <stdatomic.h> is not compatible with C++. <pyatomic.h> is only needed by the optimized PyThreadState_GET() macro in pystate.h. Instead, declare PyThreadState_GET() as an alias to PyThreadState_Get(), as done for limited API.
* Issue #19255: The builtins module is restored to initial value beforeSerhiy Storchaka2014-02-101-1/+1
| | | | cleaning other modules. The sys and builtins modules are cleaned last.
* Issue #19526: Exclude all new API from the stable ABI.Martin v. Löwis2014-01-031-0/+2
|
* Close #19199: Remove ``PyThreadState.tick_counter`` fieldVictor Stinner2013-10-091-10/+0
|
* Issue #18808: Thread.join() now waits for the underlying thread state to be ↵Antoine Pitrou2013-09-071-0/+26
| | | | | | destroyed before returning. This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
* Issue #10241: Clear extension module dict copies at interpreter shutdown.Antoine Pitrou2013-08-101-0/+3
| | | | | | Patch by Neil Schemenauer, minimally modified. (re-apply after fix for tkinter-related crash)
* Backout 62658d9d8926 (issue #10241): it causes a crash at shutdown when ↵Antoine Pitrou2013-08-021-3/+0
| | | | deallocating a Tkapp object.
* Issue #10241: Clear extension module dict copies at interpreter shutdown.Antoine Pitrou2013-08-011-0/+3
| | | | Patch by Neil Schemenauer, minimally modified.
* Issue #17912: Use a doubly linked-list for thread states.Charles-Francois Natali2013-05-081-0/+1
|
* Issue #17094: Clear stale thread states after fork().Antoine Pitrou2013-05-051-0/+1
| | | | | | | Note that this is a potentially disruptive change since it may release some system resources which would otherwise remain perpetually alive (e.g. database connections kept in thread-local storage).
* Issue #17522: Add the PyGILState_Check() API.Kristján Valur Jónsson2013-03-231-0/+5
|
* Issue #13992: The trashcan mechanism is now thread-safe. This eliminatesAntoine Pitrou2012-09-051-0/+3
| | | | | | | | | | | sporadic crashes in multi-thread programs when several long deallocator chains ran concurrently and involved subclasses of built-in container types. Because of this change, a couple extension modules compiled for 3.2.4 (those which use the trashcan mechanism, despite it being undocumented) will not be loadable by 3.2.3 and earlier. However, extension modules compiled for 3.2.3 and earlier will be loadable by 3.2.4.
* Issue #15042: Add PyState_AddModule and PyState_RemoveModule.Martin v. Löwis2012-06-221-0/+5
| | | | | | Add version guard for Py_LIMITED_API additions. Issue #15081: Document PyState_FindModule. Patch by Robin Schreiber.
* Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py.Brett Cannon2012-04-291-1/+0
| | | | Thanks to Eric Snow for the patch.
* Issue #2377: Make importlib the implementation of __import__().Brett Cannon2012-04-141-0/+2
| | | | | | | importlib._bootstrap is now frozen into Python/importlib.h and stored as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen code along with sys and imp and then uses _frozen_importlib._install() to set builtins.__import__() w/ _frozen_importlib.__import__().
* #10741: merge with 3.2Sandro Tosi2011-08-071-1/+1
|\
| * #10741: add documentation for PyGILState_GetThisThreadState()Sandro Tosi2011-08-071-1/+1
| |
| * Issue #10914: Initialize correctly the filesystem codec when creating a newVictor Stinner2011-04-261-0/+1
| | | | | | | | | | | | | | subinterpreter to fix a bootstrap issue with codecs implemented in Python, as the ISO-8859-15 codec. Add fscodec_initialized attribute to the PyInterpreterState structure.
* | Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*Antoine Pitrou2011-04-271-0/+1
|\ \ | |/ | | | | | | APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch by Charles-François Natali.
| * Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*Antoine Pitrou2011-04-271-0/+1
| | | | | | | | | | APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch by Charles-François Natali.