Added spinlocks. Tests 3 and 4 (sort of) work.