XINU
Data Structures | Macros | Variables
semaphore.h File Reference

セマフォ(セマフォ数、状態、セマフォテーブル)に関する宣言およびマクロ定義 More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sentry
 セマフォテーブルエントリであり、本構造体の配列(長さNSEM)が静的に確保される。 More...
 

Macros

#define isbadsem(s)   ((int32)(s) < 0 || (s) >= NSEM)
 セマフォIDが不適切かどうかを確認する。 More...
 
#define NSEM   120
 セマフォ数が未定義の場合は、セマフォ数を120個とする。 More...
 
#define S_FREE   0
 セマフォテーブルエントリが利用可能 More...
 
#define S_USED   1
 セマフォテーブルエントリが利用中 More...
 

Variables

struct sentry semtab []
 セマフォテーブルエントリのextern宣言 More...
 

Detailed Description

セマフォ(セマフォ数、状態、セマフォテーブル)に関する宣言およびマクロ定義

Definition in file semaphore.h.

Macro Definition Documentation

◆ isbadsem

#define isbadsem (   s)    ((int32)(s) < 0 || (s) >= NSEM)

セマフォIDが不適切かどうかを確認する。

Parameters
[in]sチェック対象のセマフォID(セマフォテーブルエントリのインデックス)
Returns
セマフォIDが負の値もしくは作成可能なセマフォ総数(NSEM)を超えている場合はtrueを返し、
それ以外の場合はfalseを返す。
Note
セマフォテーブルエントリは静的に割り当てられた配列のため、その操作には配列のインデックスを用いる。

Definition at line 40 of file semaphore.h.

Referenced by semcount(), semdelete(), semreset(), signal(), signaln(), and wait().

◆ NSEM

#define NSEM   120

セマフォ数が未定義の場合は、セマフォ数を120個とする。

Definition at line 7 of file semaphore.h.

◆ S_FREE

#define S_FREE   0

セマフォテーブルエントリが利用可能

Definition at line 11 of file semaphore.h.

Referenced by newsem(), semcount(), semdelete(), semreset(), signal(), signaln(), sysinit(), and wait().

◆ S_USED

#define S_USED   1

セマフォテーブルエントリが利用中

Definition at line 13 of file semaphore.h.

Referenced by newsem().

Variable Documentation

◆ semtab

struct sentry semtab[]

セマフォテーブルエントリのextern宣言

セマフォテーブルエントリのextern宣言

Definition at line 25 of file initialize.c.

Referenced by kill(), newsem(), semcount(), semcreate(), semdelete(), semreset(), signal(), signaln(), sysinit(), and wait().