Replaced for pthread-less version