lock os thread