close method

void close()

Close a mailbox.

If the mailbox has a message we leave the message intact so that it can be read by the consumer.

Implementation

void close() => _mutex.runLocked(() {
      assert(_mailbox.ref.magic == _magic, 'Mailbox memory corrupted/UAF');

      _mailbox.ref.open = _stateClosed;

      _condVar.notify();
    });