Add checks to mammoth thread lib
This commit is contained in:
parent
e246f28d9c
commit
a8a4f8d9ab
|
@ -1,7 +1,9 @@
|
|||
#include "include/mammoth/thread.h"
|
||||
#include "mammoth/thread.h"
|
||||
|
||||
#include <zcall.h>
|
||||
|
||||
#include "mammoth/debug.h"
|
||||
|
||||
namespace {
|
||||
|
||||
extern "C" void thread_entry(Thread::Entry entry, void* arg1) {
|
||||
|
@ -13,7 +15,8 @@ extern "C" void thread_entry(Thread::Entry entry, void* arg1) {
|
|||
} // namespace
|
||||
|
||||
Thread::Thread(Entry e, const void* arg1) {
|
||||
ZThreadCreate(Z_INIT_PROC_SELF, &thread_cap_);
|
||||
ZThreadStart(thread_cap_, reinterpret_cast<uint64_t>(thread_entry),
|
||||
reinterpret_cast<uint64_t>(e), reinterpret_cast<uint64_t>(arg1));
|
||||
check(ZThreadCreate(Z_INIT_PROC_SELF, &thread_cap_));
|
||||
check(ZThreadStart(thread_cap_, reinterpret_cast<uint64_t>(thread_entry),
|
||||
reinterpret_cast<uint64_t>(e),
|
||||
reinterpret_cast<uint64_t>(arg1)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue