registerThread - register a thread as belonging to this program