| 78 | Queue() : mgb::AsyncQueueSC<std::function<void(void)>, Queue>(0) {} |
| 79 | |
| 80 | void process_one_task(Task& f) { |
| 81 | if (!Py_IsInitialized()) |
| 82 | return; |
| 83 | pybind11::gil_scoped_acquire _; |
| 84 | f(); |
| 85 | } |
| 86 | |
| 87 | void on_async_queue_worker_thread_start() override { |
| 88 | mgb::sys::set_thread_name("py_task_worker"); |