static */
| 212 | |
| 213 | /* static */ |
| 214 | PyThreadState *PyEventLoop::_getMainThread() { |
| 215 | // The last element in the linked-list of threads associated with the main interpreter should be the main thread |
| 216 | // (The first element is the current thread, see https://github.com/python/cpython/blob/7cb3a44/Python/pystate.c#L291-L293) |
| 217 | PyInterpreterState *interp = PyInterpreterState_Main(); |
| 218 | PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); |
| 219 | while (PyThreadState_Next(tstate) != nullptr) { |
| 220 | tstate = PyThreadState_Next(tstate); |
| 221 | } |
| 222 | return tstate; |
| 223 | } |
| 224 | |
| 225 | /* static inline */ |
| 226 | PyThreadState *PyEventLoop::_getCurrentThread() { |
nothing calls this directly
no outgoing calls
no test coverage detected