diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/support/hazard.c')
-rw-r--r-- | src/third_party/wiredtiger/src/support/hazard.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/support/hazard.c b/src/third_party/wiredtiger/src/support/hazard.c index dee85586a4d..8ac8f5f9f6d 100644 --- a/src/third_party/wiredtiger/src/support/hazard.c +++ b/src/third_party/wiredtiger/src/support/hazard.c @@ -238,6 +238,25 @@ __wt_hazard_close(WT_SESSION_IMPL *session) (void *)session); } +/* + * __wt_hazard_count -- + * Count how many hazard pointers this session has on the given page. + */ +u_int +__wt_hazard_count(WT_SESSION_IMPL *session, WT_PAGE *page) +{ + WT_HAZARD *hp; + u_int count; + + for (count = 0, hp = session->hazard + session->hazard_size - 1; + hp >= session->hazard; + --hp) + if (hp->page == page) + ++count; + + return (count); +} + #ifdef HAVE_DIAGNOSTIC /* * __hazard_dump -- |