Added implementation for mutex and thread for posix (not tested yet)