forked from justellie/ProyectoSO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactor_jefe_admin.c
More file actions
44 lines (34 loc) · 1005 Bytes
/
actor_jefe_admin.c
File metadata and controls
44 lines (34 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file actor_paciente_ugc.c
* @author Juan Herrera 26.972.881
* @brief
* @version 0.1
* @date 2021-03-03
*
* @copyright Copyright (c) 2021
*
*/
#include "actores.h"
#include "definiciones.h"
//#include "main.c"
//extern UGC gestor_central;
void* actor_jefe_admin ( void* hospital ){
int i;
Hospital *datosHospital = (Hospital *) hospital;
TuplaInventario * pedir;
while (true)
{
if(refqueue_unsafe_len(&datosHospital->PCR) < NMIN_PCR )
{
pedir = malloc (sizeof(TuplaInventario));
pedir->idHospital=datosHospital->id;
pedir->cantidad=NLOTE_PCR;
pedir->tipo_recurso=PidePCR;
refqueue_put(&gestor_central.peticiones, pedir);
pthread_mutex_lock(&gestor_central.EsperandoPorRecurso);
for (i=0; i < NLOTE_PCR; i++){
refqueue_put(&datosHospital->PCR,NULL);
}
}
}
}