mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Rewrite the notification code to use smart pointers. This fixes several
fatal race conditions in notifications. This makes failure to remove a notification non-fatal (it will remove itself harmlessly when an attempt is made to notify it).
This commit is contained in:
@@ -16,12 +16,12 @@
|
||||
|
||||
class BookListeners
|
||||
{
|
||||
boost::unordered_set<InfoSub*> mListeners;
|
||||
boost::unordered_map<uint64, InfoSub::wptr> mListeners;
|
||||
public:
|
||||
typedef boost::shared_ptr<BookListeners> pointer;
|
||||
|
||||
void addSubscriber(InfoSub* sub);
|
||||
void removeSubscriber(InfoSub* sub);
|
||||
void addSubscriber(InfoSub::ref sub);
|
||||
void removeSubscriber(uint64 sub);
|
||||
void publish(Json::Value& jvObj);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user