Given that actor is defined thusly ```pub const Actor = struct {
status: ActorStatus,
system_mailbox: Channel(SystemMessage),
user_mailbox: Channel(*const Message),
handler: fn (*Actor, *const Message, *Future(bool)) callconv(.Async) void,
allocator: mem.Allocator,
schedule: bool,
pub fn init(allocator: mem.Allocator) !Actor {
const sys_buff = try allocator.alloc(SystemMessage,1024);
errdefer allocator.free(sys_buff);
var sys_chan: Channel(SystemMessage) = undefined;
sys_chan.init(sys_buff);
const user_buff = try allocator.alloc(*const Message,1024);
var user_chan: Channel(*const Message) = undefined;
user_chan.init(user_buff);
return Actor {
.status = ActorStatus.Idle,
.system_mailbox = sys_chan,
.user_mailbox = user_chan,
.handler = undefined,
.allocator = allocator,
.schedule = false,
};
}
pub fn postUserMessage(self: *Actor, msg: *const Message) void {
self.user_mailbox.put(msg);
self.schedule = true;
}```
when I try to execute actor.postUserMessage(&Message{ .message_type = MessageType.Hello, .data = "World"}); actor.postUserMessage(&Message{ .message_type = MessageType.Hello, .data = "World"}); actor.execute();
the program blocks on the second call to postUserMessage. Any ideas why this might be?