Convert libstd to use the Drop trait
This commit is contained in:
parent
8336cad95d
commit
28c7a25151
8 changed files with 107 additions and 52 deletions
|
@ -217,7 +217,10 @@ fn check_poison(is_mutex: bool, failed: bool) {
|
|||
#[doc(hidden)]
|
||||
struct PoisonOnFail {
|
||||
failed: &mut bool,
|
||||
drop {
|
||||
}
|
||||
|
||||
impl PoisonOnFail : Drop {
|
||||
fn finalize() {
|
||||
/* assert !*self.failed; -- might be false in case of cond.wait() */
|
||||
if task::failing() { *self.failed = true; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue