//
// cocos2d::extension::CCThreadPool::shutdown from 0xaab380 to 0xaab430 (176 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCThreadPool::~CCThreadPool @ 0xaab450
// > cocos2d::extension::CCHttpClient::~CCHttpClient @ 0xaab618
// > ??> @ 0x2e560
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall cocos2d::extension::CCThreadPool::shutdown(cocos2d::extension::CCThreadPool *this)
{
pthread_mutex_t *v1; // x20
__int64 v3; // x0
__int64 result; // x0
pthread_t *v5; // x20
pthread_t *i; // x19
pthread_t *v7; // x0
v1 = (pthread_mutex_t *)((char *)this + 104);
if ( this == (cocos2d::extension::CCThreadPool *)-104LL )
sub_D1410C(1);
if ( &pthread_create )
{
v3 = pthread_mutex_lock(v1);
if ( (_DWORD)v3 )
sub_D1410C(v3);
*((_BYTE *)this + 192) = 1;
pthread_mutex_unlock(v1);
}
else
{
*((_BYTE *)this + 192) = 1;
}
result = sub_D0BC80((char *)this + 144);
v5 = *((pthread_t **)this + 1);
for ( i = *(pthread_t **)this; v5 != i; result = sub_D19C6C(v7) )
{
while ( 1 )
{
result = pthread_equal(*i, 0);
if ( !(_DWORD)result )
break;
if ( v5 == ++i )
return result;
}
v7 = i++;
}
return result;
}