Add the thread functions to top level lib/util.