1.1 --- a/libfsserver/include/fsserver/file_notification.h Sat Sep 11 00:16:10 2021 +0200
1.2 +++ b/libfsserver/include/fsserver/file_notification.h Sat Sep 11 01:32:34 2021 +0200
1.3 @@ -23,26 +23,17 @@
1.4
1.5 #include <mutex>
1.6
1.7 +#include <fsserver/accountable.h>
1.8 #include <fsserver/notification.h>
1.9
1.10
1.11
1.12 /* Notification support for files. */
1.13
1.14 -class FileNotification : public NotificationSupport
1.15 +class FileNotification : public NotificationSupport, public Accountable
1.16 {
1.17 -protected:
1.18 - std::mutex _lock;
1.19 - unsigned int _attached = 0;
1.20 -
1.21 public:
1.22 explicit FileNotification();
1.23 -
1.24 - /* Accounting methods. */
1.25 -
1.26 - void attach();
1.27 -
1.28 - unsigned int detach();
1.29 };
1.30
1.31 // vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/libfsserver/lib/files/file_notification.cc Sat Sep 11 00:16:10 2021 +0200
2.2 +++ b/libfsserver/lib/files/file_notification.cc Sat Sep 11 01:32:34 2021 +0200
2.3 @@ -28,27 +28,4 @@
2.4 {
2.5 }
2.6
2.7 -/* Accounting methods. */
2.8 -
2.9 -/* Attach a user of this object. */
2.10 -
2.11 -void FileNotification::attach()
2.12 -{
2.13 - std::lock_guard<std::mutex> guard(_lock);
2.14 -
2.15 - _attached += 1;
2.16 -}
2.17 -
2.18 -/* Detach a user of this object. */
2.19 -
2.20 -unsigned int FileNotification::detach()
2.21 -{
2.22 - std::lock_guard<std::mutex> guard(_lock);
2.23 -
2.24 - if (_attached)
2.25 - _attached -= 1;
2.26 -
2.27 - return _attached;
2.28 -}
2.29 -
2.30 // vim: tabstop=4 expandtab shiftwidth=4