Skip to content

Commit

Permalink
Bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ar37-rs committed Sep 25, 2022
1 parent 93bdfd3 commit 3aa2790
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## [4.0.2] - 2022-9-26
- Fix unexpected deadlock on `result` fn.

## [4.0.1] - 2022-9-26
- Small Optimization
* Added `IntoResult` trait to convert `Option<T>` into `Result<T, E>`
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flowync"
version = "4.0.1"
version = "4.0.2"
authors = ["Ar37-rs <[email protected]>"]
edition = "2021"
description = "A simple utility for multithreading a/synchronization"
Expand Down
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,11 @@ where
///
/// **Warning!** don't use this fn if channel value is important, use `extract fn` and then use `finalize fn` instead.
pub fn result(&self, f: impl FnOnce(Result<R, String>)) {
if self.state.channel_present.load(Ordering::Relaxed) {
let _ = self.state.mtx.lock().unwrap().0.take();
self.state.cvar.notify_all();
}
if self.state.result_ready.load(Ordering::Relaxed) {
{
if self.state.channel_present.load(Ordering::Relaxed) {
let _ = self.state.mtx.lock().unwrap().0.take();
self.state.cvar.notify_all();
}
}

let _self = self;
let catch = move || {
let mut result_value = _self.state.mtx.lock().unwrap();
Expand Down

0 comments on commit 3aa2790

Please sign in to comment.