fix bug on libpthread branch