Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Jul 30, 2024
1 parent 529881e commit da6fa7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/mailbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class Mailbox {

/// Place a message into the mailbox if has space for it.
///
/// If mailbox already contains a message then [put] will throw.
/// If mailbox already contains a message or mailbox is closed then [put] will
/// throw [StateError].
void put(Uint8List message) {
final buffer = message.isEmpty ? nullptr : _toBuffer(message);
_mutex.runLocked(() {
Expand Down Expand Up @@ -102,7 +103,7 @@ class Mailbox {
/// Take a message from the mailbox.
///
/// If mailbox is empty this will synchronously block until message
/// is available.
/// is available. If mailbox is closed [take] will throw [StateError].
Uint8List take() => _mutex.runLocked(() {
while (_mailbox.ref.state == _stateEmpty) {
_condVar.wait(_mutex);
Expand Down

0 comments on commit da6fa7d

Please sign in to comment.