You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a task fails, and then during the unwind some code in a destructor calls write on a RWArc, the RWArc is poisoned. I think this is a bug. I would expect a failure that happened during one of the closures passed to write to poison it, but not a call to write that happened within a destructor during an unwind from a failure that had already occurred.
Here is some sample code that exhibits the problem--it gives the error message 'Poisoned rw_arc - another task failed inside!' whereas I would expect it to print 5:
externmod extra;use extra::arc::RWArc;use std::task;structUnwinder{i:RWArc<int>}implDropforUnwinder{fndrop(&mutself){self.i.write(|num| {*num += 3;});}}fnmain(){let a = RWArc::<int>::new(2);let a_copy = a.clone();
do task::try::<()>{
let _u = Unwinder{i:a_copy};fail!();};
a.write(|num| {println!("{:d}",*num);});}