rename lock

This commit is contained in:
Eggert Jung
2025-05-13 16:49:28 +02:00
parent 2421136335
commit a415260776
3 changed files with 12 additions and 12 deletions

View File

@@ -20,13 +20,14 @@ Und wacht sie aus'm Koma auf, kriegt sie von mir 'n Sticker\n\
\n";
extern TextStream kout;
extern Ticketlock ticketlock;
extern Ticketlock koutlock;
void activeWaitDelay(uint64_t cycles) {
uint64_t counter = 0; // Use volatile to prevent optimization
for (uint64_t i = 0; i < cycles; ++i) {
counter++; // Simple operation to consume cycles
//asm("nop");
Core::pause();
asm("nop");
//Core::pause();
}
}
@@ -34,17 +35,17 @@ void Application::action() { // NOLINT
uint16_t cnt = 0;
while (1) {
Core::Interrupt::disable();
ticketlock.lock();
koutlock.lock();
while(text[cnt++] != '\n'){
kout << text[cnt-1];
}
kout << endl << flush;
koutlock.unlock();
activeWaitDelay(10000000);
activeWaitDelay(1000000000);
if(cnt >= sizeof(text)-1)
cnt=0;
ticketlock.unlock();
Core::Interrupt::enable();
}
}