Added multithread safety
Changed documentation and added pthred to on CMAKE