//
// cocos2d::extension::CCThreadPool::shutdown from 0x7b1718 to 0x7b1752 (58 bytes)
//
// 2 xrefs:
// > cocos2d::extension::CCThreadPool::~CCThreadPool @ 0x7b1930
// > cocos2d::extension::CCHttpClient::~CCHttpClient @ 0x7b1968
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:00:07 +0000
//
std::thread *__fastcall cocos2d::extension::CCThreadPool::shutdown(cocos2d::extension::CCThreadPool *this)
{
std::mutex *v1; // r5
std::thread *v3; // r4
std::thread *v4; // r5
cocos2d::extension::CCThreadPool *v5; // t0
std::thread *result; // r0
v1 = (cocos2d::extension::CCThreadPool *)((char *)this + 36);
std::mutex::lock((cocos2d::extension::CCThreadPool *)((char *)this + 36));
*((_BYTE *)this + 44) = 1;
std::mutex::unlock(v1);
std::condition_variable::notify_all((cocos2d::extension::CCThreadPool *)((char *)this + 40));
v5 = this;
v3 = *(std::thread **)this;
v4 = *((std::thread **)v5 + 1);
while ( 1 )
{
result = v3;
if ( v3 == v4 )
break;
v3 = (std::thread *)((char *)v3 + 4);
if ( *(_DWORD *)result )
std::thread::join(result);
}
return result;
}