acadia/sys/test2.cpp

29 lines
577 B
C++
Raw Normal View History

#include <mammoth/channel.h>
2023-06-06 17:12:08 -07:00
#include <mammoth/debug.h>
#include <mammoth/thread.h>
#include <stdlib.h>
2023-06-06 16:24:03 -07:00
void thread_entry(void* a) {
dbgln("In thread");
dbgln(static_cast<const char*>(a));
2023-06-06 16:24:03 -07:00
}
int main(uint64_t bootstrap_cap) {
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";
Thread t1(thread_entry, a);
Thread t2(thread_entry, b);
uint64_t size = 10;
2023-06-07 10:48:03 -07:00
char* buff = new char[size];
Channel c1;
c1.adopt_cap(bootstrap_cap);
check(c1.ReadStr(buff, &size));
dbgln(buff);
return 0;
}