//! Exclusive writer admission, separate from shared retention protection.
use super::Session;
use crate::persistence::CrossProcessFileLock;
impl Session {
pub(crate) fn try_frontend_writer(&self) -> anyhow::Result<Option<CrossProcessFileLock>> {
let root = self
.path
.parent()
.ok_or_else(|| anyhow::anyhow!("missing root"))?;
super::store::prepare_session_root(root)?;
CrossProcessFileLock::try_acquire(&self.path.with_extension("writer"))
}
}