threads: added primitive startup code.