Accessing these variables happens in the thread context of the notify_thread.

However, they are changed in a different thread context whatever the service is calling variable changes.

So this can lead to dangerous reads and crashes. So we need a mutex.

These variable changes happen with the service-mutex set, so we could just lock that here, but it feels like a too coarse grained lock (also, we should not have access to it - see my comment about 'struct service' to pass into VariableContainer_new() to be a leaky abstraction).

So I suggest that we add a mutex in the 'struct variable_container' object that is locked within VariableContainer_change() (whne it does object->values[var_num] = new_value;) and whenever we read it here.