Linux porting

Porting to linux
Reorganising the code
Improving the scan function
This commit is contained in:
2026-03-16 23:20:22 +01:00
parent ed0326d796
commit 73b9f673a4
8 changed files with 1172 additions and 1383 deletions

View File

@@ -173,11 +173,11 @@ static void mpmc_push(MPMCQueue *q, void *item) {
} else if (diff < 0) { // queue actually full
Sleep(1000);
sleep_ms(1000);
} else { // waiting to grow
Sleep(0);
sleep_ms(0);
}
}
@@ -220,11 +220,11 @@ static void mpmc_push_work(MPMCQueue *q, void *item) {
} else if (diff < 0) { // queue actually full
Sleep(1000);
sleep_ms(1000);
} else { // waiting to grow
Sleep(0);
sleep_ms(0);
}
}
@@ -264,7 +264,7 @@ static void *mpmc_pop(MPMCQueue *q) {
} else { // slot is still transitioning (written by another thread)
if (++spins > 10) {
Sleep(0); // yield CPU
sleep_ms(0); // yield CPU
spins = 0;
} else {
cpu_pause();