mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Regarding didComplete(): When a WebInputStream is destroyed, the thread of execution will wait in SharedSession::removeTask() until the task is no longer present in the list of all active tasks. If multiple threads are all waiting in removeTask(), then all of those threads should wake when the set of active tasks changes. Waking only a single thread may result in deadlocks, as that thread's task may not have completed successfully. Then, the thread that woke up will be forced to sleep again and may not get another chance to wake. Regarding didBecomeInvalid(): Normally, didBecomeInvalid() will only be called after the SharedSession's destructor. If the destructor is running, we may assume that no other thread can access the SharedSession, so using notify_one() in didBecomeInvalid() should be sufficient to wake up the destructor's thread. However, there's a chance that the NSURLSession may be invalidated unexpectedly (i.e. before the SharedSession's destructor runs), in which case there may still be threads waiting in removeTask(). In this scenario we need to notify_all() so that all waiting threads are able to wake and make progress. |
||
|---|---|---|
| .. | ||
| containers | ||
| detail | ||
| files | ||
| json | ||
| logging | ||
| maths | ||
| memory | ||
| misc | ||
| native | ||
| network | ||
| serialisation | ||
| streams | ||
| system | ||
| text | ||
| threads | ||
| time | ||
| unit_tests | ||
| xml | ||
| zip | ||
| juce_core.cpp | ||
| juce_core.h | ||
| juce_core.mm | ||
| juce_core_CompilationTime.cpp | ||