mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-28 21:40:30 +00:00
Use futexes on OpenBSD and improve threading
This commit is contained in:
parent
5b11033d4d
commit
4f4889ddf7
17 changed files with 114 additions and 63 deletions
1
third_party/dlmalloc/dlmalloc.c
vendored
1
third_party/dlmalloc/dlmalloc.c
vendored
|
@ -23,6 +23,7 @@
|
|||
#define HAVE_MMAP 1
|
||||
#define HAVE_MREMAP 0
|
||||
#define HAVE_MORECORE 0
|
||||
#define USE_LOCKS 1
|
||||
#define USE_SPIN_LOCKS 1
|
||||
#define MORECORE_CONTIGUOUS 0
|
||||
#define MALLOC_INSPECT_ALL 1
|
||||
|
|
3
third_party/dlmalloc/platform.inc
vendored
3
third_party/dlmalloc/platform.inc
vendored
|
@ -250,12 +250,9 @@ extern void* sbrk(ptrdiff_t);
|
|||
#if USE_LOCKS
|
||||
#ifndef WIN32
|
||||
#if defined (__SVR4) && defined (__sun) /* solaris */
|
||||
#include <thread.h>
|
||||
#elif !defined(LACKS_SCHED_H)
|
||||
#include <sched.h>
|
||||
#endif /* solaris or LACKS_SCHED_H */
|
||||
#if (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0) || !USE_SPIN_LOCKS
|
||||
#include <pthread.h>
|
||||
#endif /* USE_RECURSIVE_LOCKS ... */
|
||||
#elif defined(_MSC_VER)
|
||||
#ifndef _M_AMD64
|
||||
|
|
3
third_party/gdtoa/misc.c
vendored
3
third_party/gdtoa/misc.c
vendored
|
@ -29,7 +29,6 @@
|
|||
│ THIS SOFTWARE. │
|
||||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -54,7 +53,9 @@ __gdtoa_Bclear(void)
|
|||
__gdtoa_lock();
|
||||
for (i = 0; i < ARRAYLEN(TI0.Freelist); ++i)
|
||||
__gdtoa_Brelease(TI0.Freelist[i]);
|
||||
__gdtoa_lock1();
|
||||
__gdtoa_Brelease(TI0.P5s);
|
||||
__gdtoa_unlock1();
|
||||
bzero(&TI0, sizeof(TI0));
|
||||
__gdtoa_unlock();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue