Skip to content

Commit

Permalink
Shorter sleep in thread_sleep test.
Browse files Browse the repository at this point in the history
  • Loading branch information
goyox86 committed Dec 11, 2024
1 parent e9d751b commit 68136ea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/rb-sys-tests/src/stable_api_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,6 @@ parity_test!(
name: test_rb_thread_sleep,
func: thread_sleep,
data_factory: {
std::time::Duration::from_secs(1)
std::time::Duration::from_millis(100)
}
);
3 changes: 2 additions & 1 deletion crates/rb-sys/src/stable_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
use crate::VALUE;
use std::{
os::raw::{c_char, c_long},
ptr::NonNull, time::Duration,
ptr::NonNull,
time::Duration,
};

pub trait StableApiDefinition {
Expand Down
4 changes: 2 additions & 2 deletions crates/rb-sys/src/stable_api/compiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl StableApiDefinition for Definition {
tv_sec: seconds,
tv_usec: microseconds,
};

unsafe { impl_thread_sleep(time) }
}
}
}
2 changes: 1 addition & 1 deletion crates/rb-sys/src/stable_api/ruby_2_6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl StableApiDefinition for Definition {
if self.special_const_p(obj) {
true
} else {
let rbasic = obj as *const crate::Rbasic;
let rbasic = obj as *const crate::RBasic;
((*rbasic).flags & crate::ruby_fl_type::RUBY_FL_FREEZE as VALUE) != 0
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rb-sys/src/stable_api/ruby_3_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl StableApiDefinition for Definition {
tv_sec: seconds,
tv_usec: microseconds,
};

unsafe { crate::rb_thread_wait_for(time) }
}
}

0 comments on commit 68136ea

Please sign in to comment.