mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-15 05:16:30 +00:00
Make pthread mutex non-recursive
This commit is contained in:
parent
7c83f4abc8
commit
cca0edd62b
3 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/thread/posixthread.internal.h"
|
||||
|
||||
pthread_mutex_t _pthread_lock_obj = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
pthread_mutex_t _pthread_lock_obj = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void _pthread_lock(void) {
|
||||
pthread_mutex_lock(&_pthread_lock_obj);
|
||||
|
|
|
@ -86,7 +86,7 @@ static void _onfork_child(void) {
|
|||
__proc_wipe();
|
||||
__fds_lock_obj = (pthread_mutex_t)PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
_rand64_lock_obj = (pthread_mutex_t)PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
_pthread_lock_obj = (pthread_mutex_t)PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
_pthread_lock_obj = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;
|
||||
atomic_store_explicit(&__maps.lock, 0, memory_order_relaxed);
|
||||
if (_weaken(_pthread_onfork_child))
|
||||
_weaken(_pthread_onfork_child)();
|
||||
|
|
|
@ -39,8 +39,8 @@ static const unsigned char wtable[] = {
|
|||
|
||||
int wcwidth(wchar_t wc)
|
||||
{
|
||||
if (wc < 0xff) {
|
||||
if (wc >= 0)
|
||||
if ((int)wc < 0xff) {
|
||||
if ((int)wc >= 0)
|
||||
return ((wc+1) & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue