Added a thread safe heap