Fix recursive locks when tid is huge

It turns out Linux may assign thread ids that are much larger than
previously thought. We now have fewer bits of depth so we can have
bigger tids.
This commit is contained in:
Justine Tunney 2023-01-03 05:01:00 -08:00
parent 9c72fef086
commit a4b6803556
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 4 additions and 4 deletions

View file

@ -89,7 +89,7 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) {
t = gettid();
if (mutex->_owner == t) {
if (mutex->_type != PTHREAD_MUTEX_ERRORCHECK) {
if (mutex->_depth < 255) {
if (mutex->_depth < 63) {
++mutex->_depth;
return 0;
} else {