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:
Markus Mäkelä
2018-09-26 16:05:39 +03:00
parent c0bc611f03
commit 3ee5d9a8ea
3 changed files with 32 additions and 26 deletions

View File

@ -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