diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-05-09 22:06:31 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-05-10 17:49:22 -0400 |
| commit | 0819449391714365703940844657418578461507 (patch) | |
| tree | 12bb53534db74f9870b9afe0df5483ce378950f7 /python/mainthread.py | |
| parent | a0af66644235cc8300f4b443ae90da84f901569d (diff) | |
Add name to worker tasks for debugging
Diffstat (limited to 'python/mainthread.py')
| -rw-r--r-- | python/mainthread.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/mainthread.py b/python/mainthread.py index e4911bbb..53b5c4ec 100644 --- a/python/mainthread.py +++ b/python/mainthread.py @@ -37,19 +37,19 @@ def execute_on_main_thread_and_wait(func): core.BNExecuteOnMainThreadAndWait(0, action.callback) -def worker_enqueue(func): +def worker_enqueue(func, name=""): action = scriptingprovider._ThreadActionContext(func) - core.BNWorkerEnqueue(0, action.callback) + core.BNWorkerEnqueueNamed(0, action.callback, "Python " + name) -def worker_priority_enqueue(func): +def worker_priority_enqueue(func, name=""): action = scriptingprovider._ThreadActionContext(func) - core.BNWorkerPriorityEnqueue(0, action.callback) + core.BNWorkerPriorityEnqueueNamed(0, action.callback, "Python " + name) -def worker_interactive_enqueue(func): +def worker_interactive_enqueue(func, name=""): action = scriptingprovider._ThreadActionContext(func) - core.BNWorkerInteractiveEnqueue(0, action.callback) + core.BNWorkerInteractiveEnqueueNamed(0, action.callback, "Python " + name) def get_worker_thread_count(): |
