Add watch-threads function.