hopefully added semaphores

This commit is contained in:
Simon
2025-07-14 15:24:46 +02:00
parent 42f2dd6028
commit 9d525a9602
3 changed files with 18 additions and 14 deletions

View File

@@ -9,9 +9,9 @@
#include "../../interrupt/guard.h"
#include "../../debug/output.h"
#include "../../arch/context.h"
#include "../../sync/semaphore.h"
static uint8_t appl_cnt = 0;
extern TextStream kout;
char text[] = "Ich mag\n\
Saftige Pflaumen voller Aroma\n\
Ich knuddel jede Oma ins Koma\n\
@@ -33,18 +33,21 @@ void activeWaitDelay(uint64_t cycles) {
//Core::pause();
}
}
Semaphore foo= Semaphore(1);
void Application::action() { // NOLINT
uint16_t cnt = 0;
uint8_t row = appl_cnt++;
while (1) {
Guarded g= Guard::enter();
//koutlock.lock();
{
Guarded g = Guard::enter();
//g.vault();
g.vault().kout.setPos((unsigned)8*row,(unsigned)/*Core::getID()*2+*/1);
g.vault().kout << cnt++ << flush;
foo.p(g.vault());
kout.setPos((unsigned)8*row,(unsigned)/*Core::getID()*2+*/1);
kout << cnt++ << flush;
foo.v(g.vault());
//g.vault().kout << endl << flush;
//Guard::leave();
//koutlock.unlock();