Crash in TextureCache::loadImage()

This happens with 3.17.2 and 4.0 on Android devices.

I get an intermittent crash in TextureCache::loadImage() on the call to:

_sleepCondition.wait(ul);

Another user posted the same thing back in 2020, but so far no one has responded. I know that 3.17.2 isn’t actively supported anymore, but since it happens with 4.0 I thought I’d repost it.

The Crashlytics callstack looks like this:

Thread:
#00 pc 0x19d34 libc.so 
#01 pc 0x62a09 libc.so 
#02 pc 0x39929 libc++_shared.so 
#03 pc 0x13f8486 libMyGame.so (cocos2d::TextureCache::loadImage() [CCTextureCache.cpp:243])
#04 pc 0xa289a libc++_shared.so 
#05 pc 0x1a4702a libMyGame.so (__fixsfdi [libgcc2.c:1502])
#06 pc 0x1a4702a libMyGame.so (__fixsfdi [libgcc2.c:1502])
#07 pc 0x13fc136 libMyGame.so (cocos2d::VolatileTextureMgr::reloadAllTextures() [CCTextureCache.cpp:859])
#08 pc 0x13fc176 libMyGame.so (decltype(*std::__ndk1::forward<cocos2d::TextureCache*>(fp0).*fp()) std::__ndk1::__invoke<void (cocos2d::TextureCache::*)(), cocos2d::TextureCache*, void>(void (cocos2d::TextureCache::*&&)(), cocos2d::TextureCache*&&) [type_traits:4264])