Commit ad8602a5 authored by Yoni Fogel's avatar Yoni Fogel

[t:2506] [t:2507] Added some temporary asserts

git-svn-id: file:///svn/toku/tokudb@19182 c7de825b-a66e-492c-adef-691d508d4ae1
parent bd6ae11b
......@@ -1878,6 +1878,7 @@ int toku_cachetable_unpin_and_remove (CACHEFILE cachefile, CACHEKEY key) {
if (p->key.b==key.b && p->cachefile==cachefile) {
p->dirty = CACHETABLE_CLEAN; // clear the dirty bit. We're just supposed to remove it.
assert(rwlock_readers(&p->rwlock)==1);
assert(rwlock_users(&p->rwlock) == 1); //Debug test 1
rwlock_read_unlock(&p->rwlock);
struct workqueue cq;
workqueue_init(&cq);
......@@ -1888,6 +1889,8 @@ int toku_cachetable_unpin_and_remove (CACHEFILE cachefile, CACHEKEY key) {
WORKITEM wi = 0;
r = workqueue_deq(&cq, &wi, 1);
cachetable_lock(ct);
assert(rwlock_writers(&p->rwlock) == 1); //Debug test 2
assert(rwlock_users(&p->rwlock) == 1); //Debug test 2
PAIR pp = workitem_arg(wi);
assert(r == 0 && pp == p);
cachetable_complete_write_pair(ct, p, TRUE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment