< prev index next >
src/share/vm/runtime/os.cpp
Print this page
rev 11623 : [mq]: fix-initial-active-processor-count
@@ -69,10 +69,11 @@
address os::_polling_page = NULL;
volatile int32_t* os::_mem_serialize_page = NULL;
uintptr_t os::_serialize_page_mask = 0;
long os::_rand_seed = 1;
int os::_processor_count = 0;
+int os::_initial_active_processor_count = 0;
size_t os::_page_sizes[os::page_sizes_max];
#ifndef PRODUCT
julong os::num_mallocs = 0; // # of calls to malloc/realloc
julong os::alloc_bytes = 0; // # of bytes allocated
@@ -1757,10 +1758,17 @@
}
return result;
}
#endif
+void os::set_processor_count(int count) {
+ assert(_processor_count == 0, "Trying to set processor count twice, from %d to %d", _processor_count, count);
+ _processor_count = count;
+ _initial_active_processor_count = active_processor_count();
+ log_trace(os)("Initial active processor count is %d", _initial_active_processor_count);
+}
+
/////////////// Unit tests ///////////////
#ifndef PRODUCT
#define assert_eq(a,b) assert(a == b, SIZE_FORMAT " != " SIZE_FORMAT, a, b)
< prev index next >