synchronize class allocation using a big lock