/** * * C++ class to encapsulate Unix semaphore intrinsic structures and system calls * * Author: Sistemas Operativos (Francisco Arroyo) * Version: 2023/Abr/23 * **/ #ifndef SEMAFORO_H #define SEMAFORO_H class Semaphore { public: Semaphore( int, int = 0 ); ~Semaphore(); int Signal( int = 0 ); int Wait( int = 0 ); void SP( int, int ); void SV( int, int ); void setInitialValue( int ); private: int semId; // Identificador del semaforo int nsems; // Cantidad de semaforos en el arreglo int creador; // Creador del semaforo }; #endif