wrote an atomic test and set for multi-core architecture (this is in testAndSet.cpp