Created
July 5, 2020 17:03
-
-
Save thrimbor/c32d373df6ebd250076a312534907015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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