Skip to content

Instantly share code, notes, and snippets.

@thrimbor
Created July 5, 2020 17:03
Show Gist options
  • Save thrimbor/c32d373df6ebd250076a312534907015 to your computer and use it in GitHub Desktop.
Save thrimbor/c32d373df6ebd250076a312534907015 to your computer and use it in GitHub Desktop.
#include <hal/debug.h>
#include <hal/video.h>
#include <string>
#include <vector>
#include <windows.h>
#include <stdlib.h>
#include <threads.h>
extern "C" {
int wombat () {
debugPrint("init run\n");
return 10;
}
}
void tfunc (void) {
static int randomint = wombat();
debugPrint("%d ", randomint);
randomint++;
}
int threadfunc (void *param) {
for (int i=0; i<5; i++) {
tfunc();
}
return 0;
}
int main(void) {
XVideoSetMode(640, 480, 32, REFRESH_DEFAULT);
//debugPrint("x\n");
//tfunc();
//debugPrint("y\n");
thrd_t ts[5];
for (int i=0; i<5; i++) {
thrd_create(&ts[i], threadfunc, NULL);
}
while (true) {
//tfunc();
Sleep(2000);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment