Add #[track_caller] to track callers when initializing poisoned Once
This commit is contained in:
parent
6d7684101a
commit
bca67fe02f
3 changed files with 20 additions and 0 deletions
|
@ -256,6 +256,7 @@ impl Once {
|
|||
///
|
||||
/// [poison]: struct.Mutex.html#poisoning
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[track_caller]
|
||||
pub fn call_once<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(),
|
||||
|
@ -390,6 +391,7 @@ impl Once {
|
|||
// currently no way to take an `FnOnce` and call it via virtual dispatch
|
||||
// without some allocation overhead.
|
||||
#[cold]
|
||||
#[track_caller]
|
||||
fn call_inner(&self, ignore_poisoning: bool, init: &mut dyn FnMut(&OnceState)) {
|
||||
let mut state_and_queue = self.state_and_queue.load(Ordering::Acquire);
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue