mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 06:59:10 +00:00
Make greenbean web server better
- Remove misguided __assert_disabled variable - Change EPROCLIM to be EAGAIN on BSD distros - Improve quality of greenbean with cancellations - Fix thread race condition crash with file descriptors
This commit is contained in:
parent
6cff3137c5
commit
0e087143fd
14 changed files with 247 additions and 149 deletions
|
@ -22,11 +22,13 @@
|
|||
#include "libc/thread/posixthread.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/thread/tls.h"
|
||||
#include "third_party/dlmalloc/dlmalloc.h"
|
||||
|
||||
/**
|
||||
* Releases memory of detached threads that have terminated.
|
||||
*/
|
||||
void pthread_decimate_np(void) {
|
||||
bool empty;
|
||||
struct Dll *e;
|
||||
struct PosixThread *pt;
|
||||
enum PosixThreadStatus status;
|
||||
|
@ -44,5 +46,9 @@ StartOver:
|
|||
goto StartOver;
|
||||
}
|
||||
}
|
||||
empty = dll_is_empty(_pthread_list);
|
||||
pthread_spin_unlock(&_pthread_lock);
|
||||
if (empty) {
|
||||
dlmalloc_trim(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ LIBC_THREAD_A_DIRECTDEPS = \
|
|||
LIBC_STR \
|
||||
LIBC_SYSV \
|
||||
LIBC_SYSV_CALLS \
|
||||
THIRD_PARTY_DLMALLOC \
|
||||
THIRD_PARTY_NSYNC \
|
||||
THIRD_PARTY_NSYNC_MEM
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue