mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-05-04 06:33:50 +00:00
feat: sync with Whoa implementation
This commit is contained in:
parent
12ab8f7721
commit
6928bf3f0c
46 changed files with 2980 additions and 441 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue