Implementation of Stack with and without locks.