mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Fix bugs with new memory manager
This fixes a regression in mmap(MAP_FIXED) on Windows caused by a recent revision. This change also fixes ZipOS so it no longer needs a MAP_FIXED mapping to open files from the PKZIP store. The memory mapping mutex was implemented incorrectly earlier which meant that ftrace and strace could cause cause crashes. This lock and other recursive mutexes are rewritten so that it should be provable that recursive mutexes in cosmopolitan are asynchronous signal safe.
This commit is contained in:
parent
6de12c1032
commit
464858dbb4
34 changed files with 353 additions and 313 deletions
|
@ -74,10 +74,10 @@ static void _onfork_child(void) {
|
|||
atomic_store_explicit(&free_waiters_mu, 0, memory_order_relaxed);
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
_pthread_init();
|
||||
__maps_unlock();
|
||||
if (_weaken(_pthread_onfork_child)) {
|
||||
atomic_store_explicit(&__maps.lock, 0, memory_order_relaxed);
|
||||
atomic_store_explicit(&__get_tls()->tib_relock_maps, 0, memory_order_relaxed);
|
||||
if (_weaken(_pthread_onfork_child))
|
||||
_weaken(_pthread_onfork_child)();
|
||||
}
|
||||
}
|
||||
|
||||
int _fork(uint32_t dwCreationFlags) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue