Changed locking to aquire late, release early for tableinfo.