feat: sync with Whoa implementation

This commit is contained in:
VDm 2026-04-26 17:10:11 +04:00
parent 12ab8f7721
commit 6928bf3f0c
46 changed files with 2980 additions and 441 deletions

View file

@ -6,8 +6,19 @@ CCritSect::CCritSect() {
#endif
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
#if defined(WHOA_STORM_C_CRIT_SECT_RECURSIVE)
// Use of SRgnDuplicate on systems with pthreads needs recursive locking (inside s_rgntable) to prevent deadlocks.
// This behavior doesn't appear to have carried forward to World of Warcraft, probably because SCritSect was
// preferred.
pthread_mutexattr_t mutex_attr;
pthread_mutexattr_init(&mutex_attr);
pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&this->m_critsect, &mutex_attr);
#else
pthread_mutex_init(&this->m_critsect, nullptr);
#endif
#endif
}
CCritSect::~CCritSect() {