| 108 | } |
| 109 | |
| 110 | void GDREBackgroundProgress::task_step(const String &p_task, int p_step) { |
| 111 | //this code is weird, but it prevents deadlock. |
| 112 | bool no_updates = true; |
| 113 | { |
| 114 | _THREAD_SAFE_METHOD_ |
| 115 | no_updates = updates.is_empty(); |
| 116 | } |
| 117 | |
| 118 | if (no_updates) { |
| 119 | callable_mp(this, &GDREBackgroundProgress::_update).call_deferred(); |
| 120 | } |
| 121 | |
| 122 | { |
| 123 | _THREAD_SAFE_METHOD_ |
| 124 | updates[p_task] = p_step; |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | void GDREBackgroundProgress::end_task(const String &p_task) { |
| 129 | callable_mp(this, &GDREBackgroundProgress::_end_task).call_deferred(p_task); |
no test coverage detected