Mir

Code review comment for lp:~robertcarr/mir/surface-configuration-interface--for-shell

Revision history for this message
Robert Carr (robertcarr) wrote :

I came up with another way to reduce the interface to one method.

First, we protect the state/type members of msh::Surface with a mutex (needs to happen anyway!).

Then we ensure the mutex is held while calling to SurfaceConfigurator

// Returns the configured value
int msh::SurfaceConfigurator::configure_surface(msh::Surface &, MirAttribute, int)

is enough as a single mutex. However, it seems reasonable that the SurfaceConfigurator might want to act like:

if (set_attribute == state)
   if (surface->type() == one_thing)
      // do_one_thing
   else
      // do_another

surface->type() is a deadlock though so this would require a recursive mutex.

« Back to merge proposal