Fix races conditions with SyntaxContext decoding

This commit is contained in:
John Kåre Alsaker 2023-08-22 02:36:41 +02:00
parent ef85656a10
commit e41240e45b
2 changed files with 86 additions and 34 deletions

View file

@ -171,3 +171,9 @@ impl<T> Deref for WorkerLocal<T> {
unsafe { &self.locals.get_unchecked(self.registry.id().verify()).0 }
}
}
impl<T: Default> Default for WorkerLocal<T> {
fn default() -> Self {
WorkerLocal::new(|_| T::default())
}
}