documentation for thread()