-#ifdef unix
- __sync_fetch_and_add(&latch->pin, 1);
-#else
- _InterlockedIncrement (&latch->pin);
-#endif
- // unlink our entry from its hash chain position
-
- if( latch->prev )
- bt->latchsets[latch->prev].next = latch->next;
- else
- bt->table[hashidx].slot = latch->next;
-
- if( latch->next )
- bt->latchsets[latch->next].prev = latch->prev;
-
- // now link into head of the hash chain
-
- if( latch->next = bt->table[hashidx].slot )
- bt->latchsets[latch->next].prev = slot;
-
- bt->table[hashidx].slot = slot;
- latch->prev = 0;
-