mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
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:
parent
9c72fef086
commit
a4b6803556
3 changed files with 4 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue