musst semaphore.counter public machen, hasse alles. init läuft nun

This commit is contained in:
user
2025-12-02 16:56:38 +01:00
parent 21fb133146
commit 3afa165ef3
5 changed files with 49 additions and 10 deletions

View File

@@ -25,7 +25,6 @@ class Semaphore {
// Prevent copies and assignments
Semaphore(const Semaphore&) = delete;
Semaphore& operator=(const Semaphore&) = delete;
unsigned counter;
Queue<Thread> waiting;
public:
@@ -33,6 +32,7 @@ class Semaphore {
* \param c Initial counter value
*/
explicit Semaphore(unsigned c = 0) : counter(c) {}
unsigned counter;
/*! \brief Wait for access to the critical area.
*