Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/task.c
| Context not available. | |||||
| int thread_id = thread->id; | int thread_id = thread->id; | ||||
| Task *task; | Task *task; | ||||
velocity: this is fixed locally | |||||
| BLI_thread_name_set("TaskSched:wait"); | |||||
| pthread_setspecific(scheduler->tls_id_key, thread); | pthread_setspecific(scheduler->tls_id_key, thread); | ||||
| /* keep popping off tasks */ | /* keep popping off tasks */ | ||||
| while (task_scheduler_thread_wait_pop(scheduler, &task)) { | while (task_scheduler_thread_wait_pop(scheduler, &task)) { | ||||
| TaskPool *pool = task->pool; | TaskPool *pool = task->pool; | ||||
| BLI_thread_name_set("TaskSched:run"); | |||||
sergeyUnsubmitted Done Inline ActionsI'm not sure this is a great idea to change thread name in a very hot function. Surely, is not such of a problem for release builds, but we do debug complex production scenes in a debug mode. Also, this doesn't bring a lot of new information and is not complete information. Thread which does wait_and_work is not renamed and there you can not reliably have this wait/run semantic working without having some sort of TLS stack of all names. Don't even think it worth it. sergey: I'm not sure this is a great idea to change thread name in a very hot function. Surely, is not… | |||||
velocityAuthorUnsubmitted Done Inline ActionsYeah that makes sense, I'll remove it. velocity: Yeah that makes sense, I'll remove it. | |||||
| /* run task */ | /* run task */ | ||||
| BLI_assert(!tls->do_delayed_push); | BLI_assert(!tls->do_delayed_push); | ||||
| task->run(pool, task->taskdata, thread_id); | task->run(pool, task->taskdata, thread_id); | ||||
| Context not available. | |||||
| /* Handle all tasks from local queue. */ | /* Handle all tasks from local queue. */ | ||||
| handle_local_queue(tls, thread_id); | handle_local_queue(tls, thread_id); | ||||
| BLI_thread_name_set("TaskSched:wait"); | |||||
| /* notify pool task was done */ | /* notify pool task was done */ | ||||
| task_pool_num_decrease(pool, 1); | task_pool_num_decrease(pool, 1); | ||||
| } | } | ||||
| Context not available. | |||||
this is fixed locally