mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 19:40:28 +00:00
Make fixes and improvements
- clock_nanosleep() is now much faster on OpenBSD and NetBSD - Thread joining is now much faster on NetBSD - FreeBSD timestamps are now more accurate - Thread spawning now goes faster on XNU - Clean up the clone() code
This commit is contained in:
parent
aee50b1327
commit
b407327972
47 changed files with 645 additions and 306 deletions
|
@ -16,9 +16,9 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/struct/securityattributes.h"
|
||||
#include "libc/nt/thread.h"
|
||||
|
||||
|
@ -29,7 +29,7 @@ __msabi extern typeof(CreateThread) *const __imp_CreateThread;
|
|||
*
|
||||
* @param dwStackSize may be 0 for default per executable
|
||||
* @return thread handle, or 0 on failure
|
||||
* @note this wrapper takes care of ABI, STRACE(), and __winerr()
|
||||
* @note this wrapper takes care of ABI, STRACE()
|
||||
*/
|
||||
textwindows int64_t CreateThread(
|
||||
struct NtSecurityAttributes *lpThreadAttributes, size_t dwStackSize,
|
||||
|
@ -38,7 +38,6 @@ textwindows int64_t CreateThread(
|
|||
int64_t hHandle;
|
||||
hHandle = __imp_CreateThread(lpThreadAttributes, dwStackSize, lpStartAddress,
|
||||
lpParameter, dwCreationFlags, opt_lpThreadId);
|
||||
if (hHandle == -1) __winerr();
|
||||
NTTRACE("CreateThread(%s, %'zu, %p, %p, %s, %p) → %ld% m",
|
||||
DescribeNtSecurityAttributes(lpThreadAttributes), dwStackSize,
|
||||
lpStartAddress, lpParameter, dwCreationFlags, opt_lpThreadId,
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
.underrun
|
||||
kClockNames:
|
||||
.e CLOCK_REALTIME,"REALTIME"
|
||||
.e CLOCK_REALTIME_FAST,"REALTIME_FAST"
|
||||
.e CLOCK_REALTIME_PRECISE,"REALTIME_PRECISE"
|
||||
.e CLOCK_REALTIME_FAST,"REALTIME_FAST" # order matters
|
||||
.e CLOCK_REALTIME_PRECISE,"REALTIME_PRECISE" # order matters
|
||||
.e CLOCK_REALTIME_COARSE,"REALTIME_COARSE" # order matters
|
||||
.e CLOCK_MONOTONIC,"MONOTONIC"
|
||||
.e CLOCK_MONOTONIC_FAST,"MONOTONIC_FAST"
|
||||
.e CLOCK_MONOTONIC_RAW,"MONOTONIC_RAW"
|
||||
.e CLOCK_MONOTONIC_PRECISE,"MONOTONIC_PRECISE"
|
||||
.e CLOCK_REALTIME_COARSE,"REALTIME_COARSE"
|
||||
.e CLOCK_MONOTONIC_COARSE,"MONOTONIC_COARSE"
|
||||
.e CLOCK_MONOTONIC_FAST,"MONOTONIC_FAST" # order matters
|
||||
.e CLOCK_MONOTONIC_RAW,"MONOTONIC_RAW" # order matters
|
||||
.e CLOCK_MONOTONIC_PRECISE,"MONOTONIC_PRECISE" # order matters
|
||||
.e CLOCK_MONOTONIC_COARSE,"MONOTONIC_COARSE" # order matters
|
||||
.e CLOCK_PROCESS_CPUTIME_ID,"PROCESS_CPUTIME_ID"
|
||||
.e CLOCK_THREAD_CPUTIME_ID,"THREAD_CPUTIME_ID"
|
||||
.e CLOCK_TAI,"TAI"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue