Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ polling = "2.8.0"
educe = "0.6.0"

libc = "0.2"
rand = "0.8"
rand = "0.9"
st3 = "0.4"
crossbeam-deque = "0.8"
time = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion core/src/common/ordered_work_steal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
//尝试从其他本地队列steal
let local_queues = &self.shared.local_queues;
let num = local_queues.len();
let start = rand::thread_rng().gen_range(0..num);
let start = rand::rng().random_range(0..num);
for i in 0..num {
let i = (start + i) % num;
if let Some(another) = local_queues.get(i) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/common/work_steal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl<'l, T: Debug> LocalQueue<'l, T> {
//尝试从其他本地队列steal
let local_queues = &self.shared.local_queues;
let num = local_queues.len();
let start = rand::thread_rng().gen_range(0..num);
let start = rand::rng().random_range(0..num);
for i in 0..num {
let i = (start + i) % num;
if let Some(another) = local_queues.get(i) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/net/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl DerefMut for EventLoop<'_> {
impl Default for EventLoop<'_> {
fn default() -> Self {
let max_cpu_index = num_cpus::get();
let random_cpu_index = rand::thread_rng().gen_range(0..max_cpu_index);
let random_cpu_index = rand::rng().random_range(0..max_cpu_index);
Self::new(
format!("open-coroutine-event-loop-{random_cpu_index}"),
random_cpu_index,
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/unix/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
set_errno(err);
r = -1;
break;
};
}
unsafe {
let mut address = std::mem::zeroed();
let mut address_len = socklen_t::try_from(size_of_val(&address)).expect("overflow");
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/windows/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
set_errno(err);
r = -1;
break;
};
}
unsafe {
let mut address = std::mem::zeroed();
let mut address_len = c_int::try_from(size_of_val(&address)).expect("overflow");
Expand Down
Loading