2023-06-06 16:56:19 -07:00
|
|
|
#include "mammoth/debug.h"
|
|
|
|
#include "mammoth/thread.h"
|
2023-06-06 16:24:03 -07:00
|
|
|
|
|
|
|
#define CHECK(expr) \
|
|
|
|
{ \
|
|
|
|
uint64_t code = expr; \
|
|
|
|
if (code != Z_OK) { \
|
|
|
|
ZDebug("crash!"); \
|
|
|
|
return 1; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2023-06-06 16:56:19 -07:00
|
|
|
void thread_entry(void* a) {
|
|
|
|
dbgln("In thread");
|
|
|
|
dbgln(static_cast<const char*>(a));
|
2023-06-06 16:24:03 -07:00
|
|
|
}
|
2023-05-30 20:54:37 -07:00
|
|
|
|
|
|
|
int main() {
|
2023-06-06 16:56:19 -07:00
|
|
|
dbgln("Main thread");
|
2023-06-06 16:24:03 -07:00
|
|
|
|
|
|
|
const char* a = "a";
|
|
|
|
const char* b = "bee";
|
|
|
|
const char* c = "cee";
|
|
|
|
const char* d = "dee";
|
2023-06-06 16:56:19 -07:00
|
|
|
Thread t1(thread_entry, a);
|
|
|
|
Thread t2(thread_entry, b);
|
2023-05-30 20:54:37 -07:00
|
|
|
return 0;
|
|
|
|
}
|