* Patch by Andreas that adds sched.h, and sched_yield() to Haiku.
* This closes ticket #2568. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26820 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
57f2b5a013
commit
8169e6b4e6
18
headers/posix/sched.h
Normal file
18
headers/posix/sched.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008, Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*/
|
||||
#ifndef _SCHED_H_
|
||||
#define _SCHED_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int sched_yield(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SCHED_H_ */
|
@ -21,6 +21,7 @@ MergeObject posix_main.o :
|
||||
inttypes.c
|
||||
poll.c
|
||||
$(PWD_BACKEND)
|
||||
scheduler.cpp
|
||||
semaphore.cpp
|
||||
syslog.cpp
|
||||
termios.c
|
||||
|
17
src/system/libroot/posix/scheduler.cpp
Normal file
17
src/system/libroot/posix/scheduler.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2008, Andreas Färber, andreas.faerber@web.de
|
||||
* Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#include <sched.h>
|
||||
|
||||
#include <syscalls.h>
|
||||
|
||||
|
||||
int
|
||||
sched_yield(void)
|
||||
{
|
||||
_kern_thread_yield();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user