MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / acquire

Method acquire

tests/executors.rs:104–122  ·  view source on GitHub ↗

Sets the mode up once, then holds what its runs can't share.

(self)

Source from the content-addressed store, hash-verified

102
103 /// Sets the mode up once, then holds what its runs can't share.
104 fn acquire(self) -> ModeGuard {
105 setup(self.name());
106 let fifo = || Some(RUNNER_FIFO.lock().unwrap_or_else(PoisonError::into_inner));
107 match self {
108 Mode::Simulation => ModeGuard {
109 _shared_uprobes: Some(UPROBES.read().unwrap_or_else(PoisonError::into_inner)),
110 ..Default::default()
111 },
112 Mode::Walltime { .. } => ModeGuard {
113 _runner_fifo: fifo(),
114 ..Default::default()
115 },
116 Mode::Memory => ModeGuard {
117 _exclusive_uprobes: Some(UPROBES.write().unwrap_or_else(PoisonError::into_inner)),
118 _runner_fifo: fifo(),
119 ..Default::default()
120 },
121 }
122 }
123}
124
125/// Installs the mode's tools before any of its runs, which would otherwise race

Calls 4

readMethod · 0.80
setupFunction · 0.70
nameMethod · 0.45
writeMethod · 0.45