MXS-2067: Move server lock into Server class
The lock for the server is now only visible to the MaxScale core. Changing the type to std::mutex also allows the use of RAII lock guards.
This commit is contained in:
@ -16,6 +16,10 @@
|
||||
* Internal header for the server type
|
||||
*/
|
||||
|
||||
#include <maxbase/ccdefs.hh>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include <maxbase/average.hh>
|
||||
#include <maxscale/server.h>
|
||||
#include <maxscale/resultset.hh>
|
||||
@ -48,6 +52,9 @@ public:
|
||||
response_time->add(ave, num_samples);
|
||||
}
|
||||
|
||||
// TODO: Do all access to Server via methods
|
||||
mutable std::mutex lock;
|
||||
|
||||
private:
|
||||
// nantti, TODO. Decide whether to expose some of this in config, or if the values
|
||||
// can be calculated at runtime. The "500" or sample_max affects how often a
|
||||
|
Reference in New Issue
Block a user