-
Couldn't load subscription status.
- Fork 24
Description
I had a problem:
slog_async had been freezing execution of my windows dll because it had been getting stuck waiting for thread to finish with join() (even though the thread exists successfully). This had been happening while i was waiting for AsyncGuard to drop.
My solution was to add
while !join.is_finished() {
std::thread::sleep(std::time::Duration::from_millis(50));
}
above this line
Line 393 in c2040ac
| join.join().map_err(|_| { |
.
Not a beautiful solution, so i decided not to make a pull request, but its good enough for me. Maybe it will help someone.
Im using build_with_guard(). And then before dll unloading i manually drop async_guard. With this fix drop(async_guard) finishes successfully and doesnt get stuck.
Update:
Its still unsable (sometimes it still freezes). I had to remove
join.join().map_err(|err| {
println!("prev err: {:#?}", err);
io::Error::new(
io::ErrorKind::BrokenPipe,
"Logging thread worker join error",
)
})?;
at
Line 393 in c2040ac
| join.join().map_err(|_| { |
completely to make it working (replaced with above-mentioned while basically).