Using correct API function to determine number of threads used.