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
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 figurator: :configure_ surface( msh::Surface &, MirAttribute, int)
int msh::SurfaceCon
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.