Data race in URLConnectionState

See the below stacktrace for details:

WARNING: ThreadSanitizer: race on NSMutableData (pid=86433)
  Modifying access of NSMutableData at 0x7b0c0002e8c0 by thread T11 (mutexes: write M4047):
pc_0x7fff386050ec###func_-[NSConcreteMutableData appendData:]###file_<null>###line_4818880###obj_(Foundation:x86_64+0x520eb)
pc_0x10735dd1c###func_juce::URLConnectionState::didReceiveData(NSData*)###file_juce_mac_Network.mm###line_276###obj_(engine_tests:x86_64+0x100e6dd1b)
pc_0x10735cd52###func_juce::URLConnectionState::DelegateClass::didReceiveData(objc_object*, objc_selector*, NSURLSession*, NSURLSessionDataTask*, NSData*)###file_juce_mac_Network.mm###line_382###obj_(engine_tests:x86_64+0x100e6cd51)
pc_0x7fff3486a1c1###func_<null>###file_<null>###line_4818880###obj_(CFNetwork:x86_64+0x1df1c0)
pc_0x7fff6d5c750e###func__dispatch_client_callout###file_<null>###line_4818880###obj_(libdispatch.dylib:x86_64+0x350d)
 
  Previous read-only access of NSMutableData at 0x7b0c0002e8c0 by thread T1 (mutexes: write M3980):
pc_0x7fff385fd5b7###func_-[NSConcreteMutableData length]###file_<null>###line_4818880###obj_(Foundation:x86_64+0x4a5b6)
pc_0x10735a56d###func_juce::URLConnectionState::read(char*, int)###file_juce_mac_Network.mm###line_195###obj_(engine_tests:x86_64+0x100e6a56c)
pc_0x1072ef7b7###func_juce::WebInputStream::Pimpl::read(void*, int)###file_juce_mac_Network.mm###line_1051###obj_(engine_tests:x86_64+0x100dff7b6)
pc_0x1072ef692###func_juce::WebInputStream::read(void*, int)###file_juce_WebInputStream.cpp###line_47###obj_(engine_tests:x86_64+0x100dff691)
pc_0x10724f2ea###func_juce::OutputStream::writeFromInputStream(juce::InputStream&, long long)###file_juce_OutputStream.cpp###line_306###obj_(engine_tests:x86_64+0x100d5f2e9)
pc_0x107274a6a###func_juce::MemoryOutputStream::writeFromInputStream(juce::InputStream&, long long)###file_juce_MemoryOutputStream.cpp###line_186###obj_(engine_tests:x86_64+0x100d84a69)
pc_0x107274b0b###func_juce::operator<<(juce::OutputStream&, juce::InputStream&)###file_juce_OutputStream.cpp###line_385###obj_(engine_tests:x86_64+0x100d84b0a)
pc_0x107243468###func_juce::InputStream::readEntireStreamAsString()###file_juce_InputStream.cpp###line_232###obj_(engine_tests:x86_64+0x100d53467)
pc_0x1072ed1a5###func_juce::URL::readEntireTextStream(bool) const###file_juce_URL.cpp###line_754###obj_(engine_tests:x86_64+0x100dfd1a4)

Thanks for reporting. This should now be fixed in 5cf2802.

:+1:

There was a bug in my previous commit which has been fixed here: