diff --git a/sync/spinlock.h b/sync/spinlock.h index ba73e41..a3f8941 100644 --- a/sync/spinlock.h +++ b/sync/spinlock.h @@ -35,14 +35,15 @@ class Spinlock { // Prevent copies and assignments Spinlock(const Spinlock& copy) = delete; Spinlock& operator=(const Spinlock&) = delete; - + private: + volatile uint64_t locked; public: /*! \brief Constructor; Initializes as unlocked. * * \todo(12) Complete Constructor (for \MPStuBS, or use \ref Ticketlock) * */ - consteval Spinlock() {} + consteval Spinlock() : locked(0) {} /*! \brief Enters the critical area. In case the area is already locked, * \ref lock() will actively wait until the area can be entered. @@ -50,11 +51,11 @@ class Spinlock { * \see \ref Core::pause() * \todo(12) Implement Method (for \MPStuBS, or use \ref Ticketlock) */ - void lock() {} + void lock(); /*! \brief Unblocks the critical area. * * \todo(12) Implement Method (for \MPStuBS, or use \ref Ticketlock) */ - void unlock() {} + void unlock(); };