Add Thread option for Mailboxes

This commit is contained in:
Andrea Orru 2018-03-16 01:41:45 -07:00
parent ce88034716
commit 81941f9161

View File

@ -28,7 +28,7 @@ pub const MailboxId = union(enum) {
This,
Kernel,
Port: u16,
//Thread: u16,
Thread: u16,
};
@ -96,8 +96,11 @@ pub fn exit(status: i32) noreturn {
unreachable;
}
pub fn createPort(id: u16) void {
_ = syscall1(Syscall.createPort, id);
pub fn createPort(mailbox_id: &const MailboxId) void {
_ = switch (*mailbox_id) {
MailboxId.Port => |id| syscall1(Syscall.createPort, id),
else => unreachable,
};
}
pub fn send(message: &const Message) void {