diff options
Diffstat (limited to 'core/test/app.go')
-rw-r--r-- | core/test/app.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/test/app.go b/core/test/app.go index aedcba9..5c438a7 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -191,3 +191,15 @@ Loop: } return nil } + +// Check provides a backdoor to check status of App with reader lock. +func (app *App) Check(checker func(*App)) { + app.ackedLock.RLock() + defer app.ackedLock.RUnlock() + app.totalOrderedLock.RLock() + defer app.totalOrderedLock.RUnlock() + app.deliveredLock.RLock() + defer app.deliveredLock.RUnlock() + + checker(app) +} |