This CL adds error handling for sysconf, which can return -1 and adds an RTC_CHECK_GT to ensure the value returned is always greater than 0. On top of that CpuInfo::DetectNumberOfCores is made thread safe because the static local variable is initialized with the right values istead of 0. Bug: None Change-Id: I294684e7380b12cda55ec8d6c7a90e132dc3af85 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138210 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28057}