From af3987f8d4ec692e102f5a376657651f2d698616 Mon Sep 17 00:00:00 2001 From: "Konstantin Kirik (snegovick)" Date: Thu, 4 Dec 2025 18:16:59 +0300 Subject: Replace pthread_yield with sched_yield --- emu/port/kproc-pthreads.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'emu') diff --git a/emu/port/kproc-pthreads.c b/emu/port/kproc-pthreads.c index a15a7cd3..f557a4c2 100644 --- a/emu/port/kproc-pthreads.c +++ b/emu/port/kproc-pthreads.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -89,14 +90,14 @@ tramp(void *arg) os->self = pthread_self(); if(pthread_setspecific(prdakey, arg)) panic("set specific data failed in tramp\n"); - if(0){ - pthread_attr_t attr; - memset(&attr, 0, sizeof(attr)); - pthread_getattr_np(pthread_self(), &attr); - size_t s; - pthread_attr_getstacksize(&attr, &s); - print("stack size = %d\n", s); - } + /* if(0){ */ + /* pthread_attr_t attr; */ + /* memset(&attr, 0, sizeof(attr)); */ + /* pthread_getattr_np(pthread_self(), &attr); */ + /* size_t s; */ + /* pthread_attr_getstacksize(&attr, &s); */ + /* print("stack size = %d\n", s); */ + /* } */ p->func(p->arg); pexit("{Tramp}", 0); return nil; @@ -218,7 +219,8 @@ osyield(void) { // pthread_yield_np(); /* define pthread_yield to be sched_yield or pthread_yield_np if required */ - pthread_yield(); + //pthread_yield(); + sched_yield(); } void -- cgit v1.2.3