Skip to content

Commit e2544eb

Browse files
committed
Update rand requirement from 0.8 to 0.9
1 parent 7299975 commit e2544eb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ polling = "2.8.0"
3131
educe = "0.6.0"
3232

3333
libc = "0.2"
34-
rand = "0.8"
34+
rand = "0.9"
3535
st3 = "0.4"
3636
crossbeam-deque = "0.8"
3737
time = "0.3"

core/src/common/ordered_work_steal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
359359
//尝试从其他本地队列steal
360360
let local_queues = &self.shared.local_queues;
361361
let num = local_queues.len();
362-
let start = rand::thread_rng().gen_range(0..num);
362+
let start = rand::rng().random_range(0..num);
363363
for i in 0..num {
364364
let i = (start + i) % num;
365365
if let Some(another) = local_queues.get(i) {

core/src/common/work_steal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl<'l, T: Debug> LocalQueue<'l, T> {
291291
//尝试从其他本地队列steal
292292
let local_queues = &self.shared.local_queues;
293293
let num = local_queues.len();
294-
let start = rand::thread_rng().gen_range(0..num);
294+
let start = rand::rng().random_range(0..num);
295295
for i in 0..num {
296296
let i = (start + i) % num;
297297
if let Some(another) = local_queues.get(i) {

core/src/net/event_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl DerefMut for EventLoop<'_> {
7575
impl Default for EventLoop<'_> {
7676
fn default() -> Self {
7777
let max_cpu_index = num_cpus::get();
78-
let random_cpu_index = rand::thread_rng().gen_range(0..max_cpu_index);
78+
let random_cpu_index = rand::rng().random_range(0..max_cpu_index);
7979
Self::new(
8080
format!("open-coroutine-event-loop-{random_cpu_index}"),
8181
random_cpu_index,

0 commit comments

Comments
 (0)