]> git.stg.codes - stg.git/blobdiff - projects/stargazer/user_impl.h
Use std::lock_guard instead of STG_LOCKER.
[stg.git] / projects / stargazer / user_impl.h
index ff7e28a062e52f87def05bd1e5cdf84ba3a05dab..c5b30a1d13ce373974ec53216f1157b3b280eb6f 100644 (file)
@@ -33,6 +33,7 @@
 #include <vector>
 #include <string>
 #include <set>
+#include <mutex>
 
 #include <ctime>
 #include <cstdint>
@@ -42,8 +43,8 @@ namespace STG
 
 //-----------------------------------------------------------------------------
 struct Tariff;
-struct Tariffs;
-struct Admin;
+class Tariffs;
+class Admin;
 class UserImpl;
 #ifdef USE_ABSTRACT_SETTINGS
 struct Settings;
@@ -66,7 +67,6 @@ class UserImpl : public User
                   const Users * u,
                   const Services & svcs);
         UserImpl(const UserImpl & u);
-        virtual ~UserImpl();
 
         int             ReadConf();
         int             ReadStat();
@@ -253,9 +253,11 @@ class UserImpl : public User
         ScopedConnection m_afterIPConn;
         void onIPChange(const UserIPs& oldVal, const UserIPs& newVal);
 
-        mutable pthread_mutex_t  mutex;
+        mutable std::mutex  m_mutex;
 
         std::string              errorStr;
+
+        double getPassiveTimePart() const;
 };
 //-----------------------------------------------------------------------------