@@ -66,7 +66,7 @@ impl Clock {
6666 }
6767
6868 /// Compute `now + duration` relative to this clock.
69- pub fn checked_add_since_now ( & self , duration : Duration ) -> Option < Time > {
69+ pub fn get_time_relative ( & self , duration : Duration ) -> Option < Time > {
7070 match self {
7171 Self :: Host { .. } => Instant :: now ( ) . checked_add ( duration) . map ( Time :: Monotonic ) ,
7272 Self :: Virtual { nanoseconds } =>
@@ -79,7 +79,7 @@ impl Clock {
7979
8080 /// Compute `start + duration` relative to this clock where `start` is the instant of time when
8181 /// this clock was created.
82- pub fn checked_add_since_start ( & self , duration : Duration ) -> Option < Time > {
82+ pub fn get_time_absolute ( & self , duration : Duration ) -> Option < Time > {
8383 match self {
8484 Self :: Host { time_anchor } => time_anchor. checked_add ( duration) . map ( Time :: Monotonic ) ,
8585 Self :: Virtual { .. } =>
@@ -301,10 +301,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
301301 }
302302 } ;
303303 // If adding the duration overflows, let's just sleep for an hour. Waking up early is always acceptable.
304- let timeout_time =
305- this. machine . clock . checked_add_since_now ( duration) . unwrap_or_else ( || {
306- this. machine . clock . checked_add_since_now ( Duration :: from_secs ( 3600 ) ) . unwrap ( )
307- } ) ;
304+ let timeout_time = this. machine . clock . get_time_relative ( duration) . unwrap_or_else ( || {
305+ this. machine . clock . get_time_relative ( Duration :: from_secs ( 3600 ) ) . unwrap ( )
306+ } ) ;
308307
309308 let active_thread = this. get_active_thread ( ) ;
310309 this. block_thread ( active_thread) ;
@@ -330,7 +329,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
330329 let timeout_ms = this. read_scalar ( timeout) ?. to_u32 ( ) ?;
331330
332331 let duration = Duration :: from_millis ( timeout_ms. into ( ) ) ;
333- let timeout_time = this. machine . clock . checked_add_since_now ( duration) . unwrap ( ) ;
332+ let timeout_time = this. machine . clock . get_time_relative ( duration) . unwrap ( ) ;
334333
335334 let active_thread = this. get_active_thread ( ) ;
336335 this. block_thread ( active_thread) ;
0 commit comments