add event(cond), mutex and mmap support, code only