Commit Graph

21 Commits

Author SHA1 Message Date
rdb 73360393df Switch use of Py_INCREF to new Py_NewRef function
This is more idiomatic, simplifies the code, makes it easier to port to eg. HPy later on, and makes it easier to use the limited ABI (where it can be optimized to a tail call) later on

A polyfill is provided for compatibility with Python versions 3.8 and 3.9
2024-01-29 17:57:53 +01:00
rdb cc865e6d21 pipeline: Don't exit process when SystemExit happens on external thread
PyErr_Print() causes the process to be forcibly exited when a SystemExit exception occurred, this is a big issue on Android.
2021-12-10 14:56:01 +01:00
rdb bdb2ef1631 pipeline: Fix crash upon exception in custom thread
We can't call PyErr_Restore() without a valid thread state, which won't exist in a custom thread if we just called PyGILState_Release().  Not sure how this has ever worked.
2021-03-01 16:19:53 +01:00
Daniel 4f63ef635d panda: Remove PyEval_InitThreads calls when compiling against Python 3.9+
Cherry-pick from #1053
2020-12-12 00:16:58 +01:00
rdb 97d4e32a06 general: use nassert_raise instead of nassertv(false) et al
Even a brief error message in the assertion is infinitely more useful to a user who is not at home in the source code, especially for assertions that may reasonably be triggered by honest user mistakes.
2018-11-28 17:35:20 +01:00
rdb 88b0f3327d Warning fixes and cleanups when building with SIMPLE_THREADS 2018-10-16 21:32:42 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
rdb ab5b5e7e74 Merge branch 'release/1.9.x' 2016-12-25 22:47:22 +01:00
rdb 056ea94765 Fix PythonThread crash (LP bug 1245818) 2016-12-22 21:28:19 +01:00
rdb 47388b0dbc Separate out CPython calls from core libs; eliminate need for pystub 2016-07-20 14:30:41 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb bdf91e206d Remove references to Python.h and py_config.h from Panda headers, to prevent picking up a dependency on Python libraries in third-party modules 2015-11-28 16:33:44 +01:00
David Rose a29328046a fix some threading issues 2008-09-28 17:11:42 +00:00
David Rose 524128b9fd wip: starting experimental C-based task manager 2008-09-19 00:58:04 +00:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose 3e4e3248e7 change order of thread cleanup to avoid python crash 2007-10-03 23:33:49 +00:00
David Rose 265ec8fcab use PyGILState when real threading in use 2007-10-02 22:33:18 +00:00
David Rose ae52abe2ad don't use PyGILState 2007-06-25 23:19:47 +00:00
David Rose 8d2bdc39fd first pass at SIMPLE_THREADS 2007-06-21 15:33:27 +00:00
David Rose 936412fae2 merge cow_thread_2007_04_12: make copy-on-write operations thread-safe 2007-04-19 18:23:10 +00:00