Struct style::shared_lock::SharedRwLock [] [src]

pub struct SharedRwLock { /* fields omitted */ }

A shared read/write lock that can protect multiple objects.

In Gecko builds, we don't need the blocking behavior, just the safety. As such we implement this with an AtomicRefCell instead in Gecko builds, which is ~2x as fast, and panics (rather than deadlocking) when things go wrong (which is much easier to debug on CI).

Servo needs the blocking behavior for its unsynchronized animation setup, but that may not be web-compatible and may need to be changed (at which point Servo could use AtomicRefCell too).

Methods

impl SharedRwLock
[src]

[src]

Create a new shared lock (servo).

[src]

Wrap the given data to make its access protected by this lock.

[src]

Obtain the lock for reading (servo).

[src]

Obtain the lock for writing (servo).

Trait Implementations

impl Clone for SharedRwLock
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl MallocSizeOf for SharedRwLock
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl Debug for SharedRwLock
[src]

[src]

Formats the value using the given formatter. Read more