| 261 | } |
| 262 | |
| 263 | unsigned thread::hardware_concurrency() |
| 264 | { |
| 265 | #if defined(_TTHREAD_WIN32_) |
| 266 | SYSTEM_INFO si; |
| 267 | GetSystemInfo(&si); |
| 268 | return (int) si.dwNumberOfProcessors; |
| 269 | #elif defined(_SC_NPROCESSORS_ONLN) |
| 270 | return (int) sysconf(_SC_NPROCESSORS_ONLN); |
| 271 | #elif defined(_SC_NPROC_ONLN) |
| 272 | return (int) sysconf(_SC_NPROC_ONLN); |
| 273 | #else |
| 274 | // The standard requires this function to return zero if the number of |
| 275 | // hardware cores could not be determined. |
| 276 | return 0; |
| 277 | #endif |
| 278 | } |
| 279 | |
| 280 | |
| 281 | //------------------------------------------------------------------------------ |
nothing calls this directly
no outgoing calls
no test coverage detected