mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8203227: Introduce os::processor_id() for Linux and Solaris
Reviewed-by: dholmes, rehn
This commit is contained in:
parent
ab469d40fc
commit
dface12e6d
3 changed files with 20 additions and 0 deletions
|
@ -291,6 +291,12 @@ void os::Solaris::initialize_system_info() {
|
|||
(julong)sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
uint os::processor_id() {
|
||||
const processorid_t id = ::getcpuid();
|
||||
assert(id >= 0 && id < _processor_count, "Invalid processor id");
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
int os::active_processor_count() {
|
||||
// User has overridden the number of active processors
|
||||
if (ActiveProcessorCount > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue