public IOThreadMailbox([NotNull] string name, [NotNull] Proactor proactor, [NotNull] IMailboxEvent mailboxEvent) { m_proactor = proactor; m_mailboxEvent = mailboxEvent; // Get the pipe into passive state. That way, if the users starts by // polling on the associated file descriptor it will get woken up when // new command is posted. bool ok = m_commandPipe.TryRead(out Command cmd); Debug.Assert(!ok); #if DEBUG m_name = name; #endif }
public IOThreadMailbox([NotNull] string name, [NotNull] Proactor proactor, [NotNull] IMailboxEvent mailboxEvent) { m_proactor = proactor; m_mailboxEvent = mailboxEvent; // Get the pipe into passive state. That way, if the users starts by // polling on the associated file descriptor it will get woken up when // new command is posted. Command cmd; bool ok = m_commandPipe.TryRead(out cmd); Debug.Assert(!ok); #if DEBUG m_name = name; #endif }
public IOThreadMailbox([CanBeNull] string name, [NotNull] Proactor proactor, [NotNull] IMailboxEvent mailboxEvent) { m_proactor = proactor; m_mailboxEvent = mailboxEvent; m_cpipe = new YPipe <Command>(Config.CommandPipeGranularity, "mailbox"); m_sync = new object(); // Get the pipe into passive state. That way, if the users starts by // polling on the associated file descriptor it will get woken up when // new command is posted. var cmd = new Command(); bool ok = m_cpipe.Read(ref cmd); Debug.Assert(!ok); m_name = name; m_disposed = false; }