XINU
Functions
yield.c File Reference

CPU実行権を自発的に放棄する(タイムスライスを終了する) More...

#include <xinu.h>
Include dependency graph for yield.c:

Go to the source code of this file.

Functions

syscall yield (void)
 CPU実行権を自発的に放棄する(タイムスライスを終了する)。 More...
 

Detailed Description

CPU実行権を自発的に放棄する(タイムスライスを終了する)

Definition in file yield.c.

Function Documentation

◆ yield()

syscall yield ( void  )

CPU実行権を自発的に放棄する(タイムスライスを終了する)。

割り込みを禁止して再スケジューリングを行う。復帰後、割り込み状態を復元する。

Returns
OKを返す。

Definition at line 12 of file yield.c.

References disable(), OK, resched(), and restore().

Referenced by sleepms().

13 {
14  intmask mask; /* Saved interrupt mask */
15 
16  mask = disable();
17  resched();
18  restore(mask);
19  return OK;
20 }
void restore(intmask)
#define OK
処理が成功した場合
Definition: kernel.h:77
uint32 intmask
保存された割り込みマスク
Definition: kernel.h:38
void resched(void)
最優先の適切なプロセスにCPU実行権を渡す。
Definition: resched.c:22
intmask disable(void)
割り込み禁止(intr.Sに定義がある)
Here is the call graph for this function:
Here is the caller graph for this function: