Add support for using the current thread id.