- if( pool = bt_findpool(bt, page_no, idx) ) {
-#ifdef unix
- __sync_fetch_and_add(&pool->pin, 1);
-#else
- _InterlockedIncrement16 (&pool->pin);
-#endif
- bt_spinreleaseread (&bt->mgr->latch[idx], 1);
- pool->lru++;
- return pool;
- }
-
- // upgrade to write lock
-
- bt_spinreleaseread (&bt->mgr->latch[idx], 1);
- bt_spinwritelock (&bt->mgr->latch[idx], 1);
-
- // try to find page in pool with write lock
-
- if( pool = bt_findpool(bt, page_no, idx) ) {