00001 00012 #ifndef LISTA_H_ 00013 #define LISTA_H_ 00014 00015 #include "common.h" 00016 00018 #define EMPTY 0 00019 00024 #define FULL THREAD_MAX 00025 00027 typedef enum {false, true} boolean; 00028 00030 struct thread{ 00031 channel_t sk_cl; 00032 struct thread *next; 00033 }; 00034 00036 struct lista{ 00037 int num_threads; 00038 struct thread *top_elem; 00039 }; 00040 00048 void inizializza(struct lista *stack); 00049 00060 int ins_new_elem(channel_t sk_cl, struct lista *stack); 00061 00071 channel_t estrazione(struct lista *stack); 00072 00083 boolean full(const struct lista *stack); 00084 00097 int rimuovi(channel_t sk_cl, struct lista *s); 00098 00108 channel_t leggi_sk_cl(struct lista *stack); 00109 00110 #endif /*LISTA_H_*/