# HG changeset patch # User Paul Boddie # Date 1631316754 -7200 # Node ID b3cae22cced5739a83398b6c80cb932247d84901 # Parent 494753f0112be086b3d4aed866a3f0accf65cc1b Made the file notification manager use the accountable object support. diff -r 494753f0112b -r b3cae22cced5 libfsserver/include/fsserver/file_notification.h --- a/libfsserver/include/fsserver/file_notification.h Sat Sep 11 00:16:10 2021 +0200 +++ b/libfsserver/include/fsserver/file_notification.h Sat Sep 11 01:32:34 2021 +0200 @@ -23,26 +23,17 @@ #include +#include #include /* Notification support for files. */ -class FileNotification : public NotificationSupport +class FileNotification : public NotificationSupport, public Accountable { -protected: - std::mutex _lock; - unsigned int _attached = 0; - public: explicit FileNotification(); - - /* Accounting methods. */ - - void attach(); - - unsigned int detach(); }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 494753f0112b -r b3cae22cced5 libfsserver/lib/files/file_notification.cc --- a/libfsserver/lib/files/file_notification.cc Sat Sep 11 00:16:10 2021 +0200 +++ b/libfsserver/lib/files/file_notification.cc Sat Sep 11 01:32:34 2021 +0200 @@ -28,27 +28,4 @@ { } -/* Accounting methods. */ - -/* Attach a user of this object. */ - -void FileNotification::attach() -{ - std::lock_guard guard(_lock); - - _attached += 1; -} - -/* Detach a user of this object. */ - -unsigned int FileNotification::detach() -{ - std::lock_guard guard(_lock); - - if (_attached) - _attached -= 1; - - return _attached; -} - // vim: tabstop=4 expandtab shiftwidth=4