Opened 16 years ago
Closed 16 years ago
#2568 closed enhancement (fixed)
[PATCH] Implement sched_yield
Reported by: | andreasf | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Haiku does not have a sched.h
header and the sched_yield
function.
It appears to be an optional POSIX feature.
Attachments (2)
Change History (12)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Attached is a first shot at implementing it. It compiles but is still untested.
I have no idea if the syscall does the correct thing...
comment:3 by , 16 years ago
"os" always means OS APIs, not POSIX APIs. So os/scheduler.c and os/kernel/schduler.h is not where this would be added. Since this is a POSIX feature, it should be put into libroot/posix/sched.c[pp] and headers/posix/sched.h. The syscall looks good.
comment:4 by , 16 years ago
Oh, BTW, our coding style wants two blank lines between functions (ie. in scheduler.c of your patch).
comment:5 by , 16 years ago
Okay, I just didn't want to mix my code into GPL'ed glibc files. A headers/posix/sched.h
file was already part of the patch.
Actually I didn't yet read the coding guidelines at all... The existing scheduler.c
file is wrong then. ;)
comment:6 by , 16 years ago
Patch updated to use a new libroot/posix/scheduler.cpp
file. Compiles okay, untested.
With the previous version (and my workarounds reverted), Mono did link okay. No noticable behavioral change.
comment:7 by , 16 years ago
Summary: | Implement sched_yield → [PATCH] Implement sched_yield |
---|
Still links and runs as before.
comment:8 by , 16 years ago
Looks good, do you mind if I remove the /X11 license part? It looks a bit pointless to me.
comment:10 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks! I've applied it in hrev26820.
I'd be interested to help implementing it. Would
libroot/os/scheduler.c
be a suitable place for it?