add ThreadSafeStack class.