-some consistency changes
-portThdExit() calls back the esThdTerm() function