Mir

mir:extra-fancy-synchronised

Last commit made on 2022-07-01
Get this branch:
git clone -b extra-fancy-synchronised https://git.launchpad.net/mir

Branch merges

Branch information

Name:
extra-fancy-synchronised
Repository:
lp:mir

Recent commits

7455474... by Chris Halse Rogers

core/Synchronised: Add Synchronised::try_lock_for

0d54092... by "bors[bot]" <26634292+bors[bot]@users.noreply.github.com>

Merge #2483

2483: scene/BasicSurface: Switch to a data-owning Mutex r=AlanGriffiths a=RAOF

There's a *lot* of state that's guarded by this one mutex, but that's how the
current code works.

Fixes up a couple of places in the code where these values were accidentally
accessed without the lock held.

Co-authored-by: Christopher James Halse Rogers <email address hidden>
Co-authored-by: Sophie Winter <email address hidden>
Co-authored-by: Alan Griffiths <email address hidden>

bd09784... by Alan Griffiths

Fix typo

beb5721... by Chris Halse Rogers

core/Synchronised: Make code holding a `Locked` cleaner.

We have some existing code in `linux_virtual_terminal.cpp` that wants
to specifically hold access to the synchronised data over multiple
calls.

Add some `using`s to make code like that cleaner.

2ce360d... by Chris Halse Rogers

core/Mutex: Rename to `Synchronised<T>`

Also, discover that we've previously *had* this naming discussion and
settled on `Synchronised`, so remove the *other* copy of `mir::Synchronised<T>`
that's lying around in the server code.

c7a2bbb... by Chris Halse Rogers

scene/BasicSurface: Rename to `synchronised_state`

`mutable_state` is indeed a bad name; maybe 'synchronised_state' is better?

c81ee09... by Chris Halse Rogers

scene/BasicSurface: Drop `mutable` qualifier on `Mutex<State>`

Now that `Mutex<State> const` allows access to `State const` we can
drop the `mutable` qualifier and our `const` methods can get read-only
access to the `State`, as intended.

eb67bbc... by Chris Halse Rogers

core/Mutex: Clean up code style

8cd150c... by Chris Halse Rogers

core/Mutex: Add a const overload for lock()

This lets us give out `const` access to the guarded value in const-context,
and unrestricted access in non-const-context.

d9a3a0e... by Chris Halse Rogers

core/Mutex: Mark MutexGuard accessors const.

They don't mutate the `MutexGuard` itself (unlike `drop()`), so we can
usefully mark them const.