This implementation seems to have some issues. When I use one thread to push and another thread to pop, a memory error occurs.