Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Mar 8, 2024
1 parent e5bebe8 commit 4b7aec5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://github.com/al8n/wg"
repository = "https://github.com/al8n/wg.git"
documentation = "https://docs.rs/wg/"
readme = "README.md"
version = "0.7.3"
version = "0.7.4"
license = "MIT OR Apache-2.0"
keywords = ["waitgroup", "async", "sync", "notify", "wake"]
categories = ["asynchronous", "concurrency", "data-structures"]
Expand Down
2 changes: 1 addition & 1 deletion src/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl AsyncWaitGroup {
/// });
/// # })
/// ```
pub fn done(self) {
pub fn done(&self) {
if self.inner.counter.fetch_sub(1, Ordering::SeqCst) == 1 {
self.inner.event.notify(usize::MAX);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl WaitGroup {
/// });
///
/// ```
pub fn done(self) {
pub fn done(&self) {
let mut val = self.inner.count.lock_me();

*val = if val.eq(&1) {
Expand Down
2 changes: 1 addition & 1 deletion src/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl AsyncWaitGroup {
/// });
/// }
/// ```
pub fn done(self) {
pub fn done(&self) {
if self.inner.counter.fetch_sub(1, Ordering::SeqCst) == 1 {
self.inner.notify.notify_waiters();
}
Expand Down

0 comments on commit 4b7aec5

Please sign in to comment.