Skip to content

Commit 9ebc5b6

Browse files
author
duke
committedNov 30, 2020
Automatic merge of jdk:master into master
2 parents b6b4cac + 4db05e9 commit 9ebc5b6

File tree

7 files changed

+4
-14
lines changed

7 files changed

+4
-14
lines changed
 

‎src/hotspot/os/aix/os_aix.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2464,8 +2464,6 @@ void os::init(void) {
24642464

24652465
clock_tics_per_sec = sysconf(_SC_CLK_TCK);
24662466

2467-
init_random(1234567);
2468-
24692467
// _main_thread points to the thread that created/loaded the JVM.
24702468
Aix::_main_thread = pthread_self();
24712469

‎src/hotspot/os/bsd/os_bsd.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2089,8 +2089,6 @@ void os::init(void) {
20892089

20902090
clock_tics_per_sec = CLK_TCK;
20912091

2092-
init_random(1234567);
2093-
20942092
Bsd::set_page_size(getpagesize());
20952093
if (Bsd::page_size() == -1) {
20962094
fatal("os_bsd.cpp: os::init: sysconf failed (%s)", os::strerror(errno));

‎src/hotspot/os/linux/os_linux.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -4394,8 +4394,6 @@ void os::init(void) {
43944394

43954395
clock_tics_per_sec = sysconf(_SC_CLK_TCK);
43964396

4397-
init_random(1234567);
4398-
43994397
Linux::set_page_size(sysconf(_SC_PAGESIZE));
44004398
if (Linux::page_size() == -1) {
44014399
fatal("os_linux.cpp: os::init: sysconf failed (%s)",

‎src/hotspot/os/windows/os_windows.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -4164,8 +4164,6 @@ void nx_check_protection() {
41644164
void os::init(void) {
41654165
_initial_pid = _getpid();
41664166

4167-
init_random(1234567);
4168-
41694167
win32::initialize_system_info();
41704168
win32::setmode_streams();
41714169
init_page_sizes((size_t) win32::vm_page_size());

‎src/hotspot/share/prims/whitebox.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ static jint wb_stress_virtual_space_resize(size_t reserved_space_size,
299299

300300
int seed = os::random();
301301
tty->print_cr("Random seed is %d", seed);
302-
os::init_random(seed);
303302

304303
for (size_t i = 0; i < iterations; i++) {
305304

‎src/hotspot/share/runtime/os.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
OSThread* os::_starting_thread = NULL;
7474
address os::_polling_page = NULL;
75-
volatile unsigned int os::_rand_seed = 1;
75+
volatile unsigned int os::_rand_seed = 1234567;
7676
int os::_processor_count = 0;
7777
int os::_initial_active_processor_count = 0;
7878
size_t os::_page_sizes[os::page_sizes_max];

‎test/hotspot/gtest/runtime/test_os.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -120,10 +120,10 @@ TEST(os, test_random) {
120120
unsigned int seed = 1;
121121

122122
// tty->print_cr("seed %ld for %ld repeats...", seed, reps);
123-
os::init_random(seed);
124123
int num;
125124
for (int k = 0; k < reps; k++) {
126-
num = os::random();
125+
// Use next_random so the calculation is stateless.
126+
num = seed = os::next_random(seed);
127127
double u = (double)num / m;
128128
ASSERT_TRUE(u >= 0.0 && u <= 1.0) << "bad random number!";
129129

@@ -148,7 +148,6 @@ TEST(os, test_random) {
148148
ASSERT_LT(t, eps) << "bad variance";
149149
}
150150

151-
152151
#ifdef ASSERT
153152
TEST_VM_ASSERT_MSG(os, page_size_for_region_with_zero_min_pages, "sanity") {
154153
size_t region_size = 16 * os::vm_page_size();

0 commit comments

Comments
 (0)
Please sign in to comment.