mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 08:20: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
|
@ -39,8 +39,8 @@ void *Worker(void *arg) {
|
|||
|
||||
TEST(tkill, test) {
|
||||
if (IsWindows()) return; // TODO(jart): fix me
|
||||
int i;
|
||||
void *res;
|
||||
int i, tid;
|
||||
pthread_t t;
|
||||
sigset_t ss, oldss;
|
||||
sighandler_t oldsig;
|
||||
|
@ -49,7 +49,8 @@ TEST(tkill, test) {
|
|||
oldsig = signal(SIGUSR1, OnSig);
|
||||
ASSERT_SYS(0, 0, sigprocmask(SIG_BLOCK, &ss, &oldss));
|
||||
ASSERT_EQ(0, pthread_create(&t, 0, Worker, 0));
|
||||
ASSERT_SYS(0, 0, tkill(pthread_getunique_np(t), SIGUSR1));
|
||||
ASSERT_EQ(0, pthread_getunique_np(t, &tid));
|
||||
ASSERT_SYS(0, 0, tkill(tid, SIGUSR1));
|
||||
ASSERT_EQ(0, pthread_join(t, &res));
|
||||
ASSERT_EQ(SIGUSR1, (intptr_t)res);
|
||||
ASSERT_SYS(0, 0, sigprocmask(SIG_SETMASK, &oldss, 0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue