Details
Description
There should be an option to have shiboken2 not deal with the GIL in generated code per default. This could be enabled on the command line of shiboken2 or via the typesystem.xml. Scope should be global or at least per type (class).
It's all about code generated like this (for most, if not all, methods):
PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS // ...my code here... PyEval_RestoreThread( _save ); // Py_END_ALLOW_THREADS
I don't want shiboken2 to do those PyEval_SaveThread()- / PyEval_RestoreThread( _save )-calls. Reason: I don't want shiboken2 to make assumptions about the code the user may add there. In my case, for instance, I really need to hold the GIL there in many cases.
I've read about the "modify-function" node along with "allow-thread" here: modify-function. This is nice but would require me to apply it to each and every method (I've really a lot of those )
Attachments
Issue Links
- relates to
-
PYSIDE-1788 overriden methods should allow threads during long Qt operations
- Closed
For Gerrit Dashboard: PYSIDE-931 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
252802,6 | shiboken: Add allow-thread attribute to type system and class entries | 5.12 | pyside/pyside-setup | Status: MERGED | -2 | 0 |
254427,2 | shiboken: Extend the exception handling test | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
254524,1 | shiboken: Introduce a class context struct to AbstractMetaBuilderPrivate | 5.12 | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
391739,2 | shiboken6: Fix broken if statement when setting allow-thread | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
391867,2 | shiboken6: Fix broken if statement when setting allow-thread | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
391889,1 | shiboken6: Fix broken if statement when setting allow-thread | 5.15 | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
391973,2 | shiboken6: Fix broken if statement when setting allow-thread | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |