explain latch manager in foster btree code