Convert libstd to use the Drop trait
This commit is contained in:
parent
4b0e1336b2
commit
4589597785
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