use atomic instructions to update the inuse counters