Jacek Caban (@jacek) commented about dlls/mshtml/mutation.c:
static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface) { + thread_data_t *thread_data = get_thread_data(FALSE); nsRunnable *This = impl_from_nsIRunnable(iface); + nsresult nsres; + + if(!thread_data) + return NS_ERROR_OUT_OF_MEMORY;
- return This->proc(This->doc, This->arg1, This->arg2); + thread_data->tasks_locked++; + nsres = This->proc(This->doc, This->arg1, This->arg2); + if(!--thread_data->tasks_locked) + unblock_tasks_and_timers(thread_data); + return nsres;
I think it would make sense to abstract thread data handling details from places like this or event handler. This could look like: ``` block_task_processing(); This->proc(...); unblock_task_processing(); ``` Maybe we could even use the same helpers in `hidden_proc` itself. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6375#note_82014