/** * * Esta clase simula las funciones de Locks * * Autor: Sistemas Operativos (Francisco Arroyo) * * Fecha: 2023/Abr/23 * **/ #include #include #include #include #include "Lock.h" /** * Creates a lock, using a semaphore **/ Lock::Lock() { lock = new Semaphore( 1, 1 ); } /** * Destroys the lock **/ Lock::~Lock() { delete this->lock; } /** * Acquires the lock * **/ void Lock::Acquire() { this->lock->Wait(); } /** * Release the lock * **/ void Lock::Release() { this->lock->Signal(); }