These are chat archives for rust-lang/rust

3rd
Feb 2016
gallexme
@gallexme
Feb 03 2016 18:19
is there anyway to manually unlock a mutex?
Vladimir Matveev
@netvl
Feb 03 2016 18:20
@gallexme sure, drop the mutex guard explicitly
Jarred Nicholls
@jnicholls
Feb 03 2016 18:20
drop(mutex)
Vladimir Matveev
@netvl
Feb 03 2016 18:20
let mg = mutex.lock().unwrap();
// work with mg
drop(mg);
// here mutex is unlocked
gallexme
@gallexme
Feb 03 2016 18:21
i really didnt thought i would get ssuch a answer :D thanks, i expected someone saying that its probably bad code design by me
im pretty new
Vladimir Matveev
@netvl
Feb 03 2016 18:22
well, it probably is, and it may be better to restructure the code with blocks, but everything depends on the exact situation, IMO :)
gallexme
@gallexme
Feb 03 2016 18:22
you can have a look at it here if u want: http://pastebin.com/s8QJwN6B
but yeah now it works perfectly finally i can read it^^
gallexme
@gallexme
Feb 03 2016 18:29
++*