Skip to content

Commit

Permalink
Update ValidationInterface() documentation to explicitly specify thre…
Browse files Browse the repository at this point in the history
…ading and memory model

Github-Pull: #2290
Rebased-From: f9d2ab3
  • Loading branch information
skeees authored and furszy committed Apr 8, 2021
1 parent f499e6e commit c202bc1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/validationinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ void CallFunctionInValidationInterfaceQueue(std::function<void ()> func);
*/
void SyncWithValidationInterfaceQueue();

/**
* Implement this to subscribe to events generated in validation
*
* Each CValidationInterface() subscriber will receive event callbacks
* in the order in which the events were generated by validation.
* Furthermore, each ValidationInterface() subscriber may assume that
* callbacks effectively run in a single thread with single-threaded
* memory consistency. That is, for a given ValidationInterface()
* instantiation, each callback will complete before the next one is
* invoked. This means, for example when a block is connected that the
* UpdatedBlockTip() callback may depend on an operation performed in
* the BlockConnected() callback without worrying about explicit
* synchronization. No ordering should be assumed across
* ValidationInterface() subscribers.
*/
class CValidationInterface {
public:
virtual ~CValidationInterface() = default;
Expand Down

0 comments on commit c202bc1

Please sign in to comment.