Fix the build

This commit is contained in:
Justine Tunney 2022-11-11 11:13:21 -08:00
parent f2af97711b
commit d55b019284
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 9 additions and 5 deletions

View file

@ -42,7 +42,7 @@
* @cancellationpoint
*/
errno_t _wait0(const atomic_int *ctid, struct timespec *abstime) {
int x, rc = 0;
int x, e, rc = 0;
// "The behavior is undefined if the value specified by the thread
// argument to pthread_join() refers to the calling thread."
// ──Quoth POSIX.1-2017
@ -52,11 +52,11 @@ errno_t _wait0(const atomic_int *ctid, struct timespec *abstime) {
if (!(rc = pthread_testcancel_np())) {
BEGIN_CANCELLATION_POINT;
while ((x = atomic_load_explicit(ctid, memory_order_acquire))) {
rc = nsync_futex_wait_(ctid, x, !IsWindows(), abstime);
if (rc == -ECANCELED) {
e = nsync_futex_wait_(ctid, x, !IsWindows(), abstime);
if (e == -ECANCELED) {
rc = ECANCELED;
break;
} else if (rc == -ETIMEDOUT) {
} else if (e == -ETIMEDOUT) {
rc = EBUSY;
break;
}

View file

@ -22,8 +22,9 @@
#include "libc/fmt/fmt.h"
#include "libc/macros.internal.h"
#include "libc/math.h"
#include "libc/mem/mem.h"
#include "libc/mem/gc.internal.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/vendor.internal.h"
#include "libc/runtime/internal.h"
#include "libc/runtime/stack.h"
#include "libc/stdio/stdio.h"
@ -136,6 +137,7 @@ static const struct {
};
TEST(printf, longdouble) {
if (IsGenuineCosmo()) return; // TODO(jart): long double precision in blink
int i;
for (i = 0; i < ARRAYLEN(Vx); ++i) {
++g_testlib_ran;

View file

@ -26,6 +26,7 @@
#include "libc/mem/gc.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/nexgen32e/vendor.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/stack.h"
#include "libc/sysv/consts/prot.h"
@ -98,6 +99,7 @@ static void *CheckSchedule(void *arg) {
TEST(pthread_create, scheduling) {
pthread_t id;
pthread_attr_t attr;
if (IsGenuineCosmo()) return; // TODO(jart): blink
struct sched_param pri = {sched_get_priority_min(SCHED_OTHER)};
ASSERT_EQ(0, pthread_attr_init(&attr));
ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED));