mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Make the rule tree actually threadsafe
RuleTree::gc is now a safe method that any thread can call at any time, and StrongRuleNode values can all be dropped whenever their owner want to, on any thread.
This commit is contained in:
parent
1c2de5641c
commit
7f54d14904
4 changed files with 316 additions and 320 deletions
|
@ -44,6 +44,16 @@ impl<T> UnsafeBox<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the inner value of this unsafe box.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Given `Self::clone`, nothing prevents anyone from creating
|
||||
/// multiple mutable references to the inner value, which is completely UB.
|
||||
pub(crate) unsafe fn deref_mut(this: &mut Self) -> &mut T {
|
||||
&mut this.inner
|
||||
}
|
||||
|
||||
/// Drops the inner value of this unsafe box.
|
||||
///
|
||||
/// # Safety
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue