Ticket #2568: sched_yield-02.diff

File sched_yield-02.diff, 1.3 KB (added by andreasf, 16 years ago)

Draft patch

  • src/system/libroot/posix/Jamfile

     
    2121    inttypes.c
    2222    poll.c
    2323    $(PWD_BACKEND)
     24    scheduler.cpp
    2425    semaphore.cpp
    2526    syslog.cpp
    2627    termios.c
  • src/system/libroot/posix/scheduler.cpp

     
     1/*
     2 * Copyright 2008, Andreas Färber, andreas.faerber@web.de
     3 * Distributed under the terms of the MIT/X11 license.
     4 */
     5
     6#include <sched.h>
     7
     8#include <syscalls.h>
     9
     10
     11int
     12sched_yield(void)
     13{
     14    _kern_thread_yield();
     15    return 0;
     16}
     17
  • headers/posix/sched.h

     
     1/*
     2 * Copyright 2008, Haiku Inc. All rights reserved.
     3 * Distributed under the terms of the MIT license.
     4 */
     5#ifndef _SCHED_H_
     6#define _SCHED_H_
     7
     8#ifdef __cplusplus
     9extern "C" {
     10#endif
     11
     12
     13extern int sched_yield(void);
     14
     15
     16#ifdef __cplusplus
     17}
     18#endif
     19
     20#endif  /* _SCHED_H_ */
     21