mirror of https://github.com/grpc/grpc.git
__NR_getcpu isn't implemented on qemu, and for some reason sysconf(_SC_NPROCESSORS_ONLN) returns the number of processers of the host system, giving a false indication that there is more than one cpu for the qemu case. Expand the init_num_cpus sequence to also run sched_getcpu once, if GPR_MUSL_LIBC_COMPAT isn't defined. If that call isn't supported, initialize 'ncpus' to 1. Later, in gpr_cpu_current_cpu, use gpr_cpu_num_cores to avoid the system call in cases where we know it isn't supported, or if the ncpus is otherwise 1.pull/13138/head
parent
80eee985f4
commit
b6b8de1758
1 changed files with 10 additions and 0 deletions
Loading…
Reference in new issue