My Project
Chargement...
Recherche...
Aucune correspondance
include
manux
semaphore.h
Aller à la documentation de ce fichier.
1
/*----------------------------------------------------------------------------*/
2
/* Définition des sémaphores et opértions associées. */
3
/* */
4
/* (C) Manu Chaput 2000 */
5
/*----------------------------------------------------------------------------*/
6
#ifndef SEMAPHORE_DEF
7
#define SEMAPHORE_DEF
8
9
#include <manux/types.h>
10
#include <
manux/atomique.h
>
11
#include <
manux/listetaches.h
>
12
13
/*
14
* Le type de base
15
*/
16
typedef
struct
_Semaphore
{
17
int
valeur
;
18
Atomique
verrou
;
19
ListeTache
tachesEnAttente
;
20
}
Semaphore
;
21
22
void
semInit
(
Semaphore
* sem,
int
val);
23
/*
24
* Définition de la valeur initiale d'un sémaphore
25
*/
26
27
void
semObtenir
(
Semaphore
* sem);
28
/*
29
* Obtention d'une ressource. Cette opération est bloquante.
30
*/
31
32
void
semRelacher
(
Semaphore
* sem);
33
/*
34
* Remise au système d'une ressource préalablement obtenue.
35
*/
36
37
#endif
atomique.h
Définition des opérations de synchronisation de ManuX.
Atomique
uint32_t Atomique
Definition
atomique.h:19
listetaches.h
semInit
void semInit(Semaphore *sem, int val)
Definition
semaphore.c:10
semObtenir
void semObtenir(Semaphore *sem)
Definition
semaphore.c:16
Semaphore
struct _Semaphore Semaphore
semRelacher
void semRelacher(Semaphore *sem)
Definition
semaphore.c:24
_ListeTache
Definition
listetaches.h:18
_Semaphore
Definition
semaphore.h:16
_Semaphore::tachesEnAttente
ListeTache tachesEnAttente
Definition
semaphore.h:19
_Semaphore::verrou
Atomique verrou
Definition
semaphore.h:18
_Semaphore::valeur
int valeur
Definition
semaphore.h:17
Généré par
1.9.8