src/app/jdk/lib/jvm/os_genode.cpp
// utility to compute the abstime argument to timedwait:
// millis is the relative timeout time
// abstime will be the absolute timeout time
// TODO: replace compute_abstime() with unpackTime()
utility to compute the abstime argument to timedwait:
millis is the relative timeout time
abstime will be the absolute timeout time
TODO: replace compute_abstime() with unpackTime()
utility to compute the abstime argument to timedwait : millis is the relative timeout time abstime will be the absolute timeout time TODO : replace compute_abstime () with unpackTime ()
static struct timespec* compute_abstime(struct timespec* abstime,
                                        jlong millis) {
  if (millis < 0)  millis = 0;
  struct timeval now;
  int status = gettimeofday(&now, NULL);
  assert(status == 0, "gettimeofday");
  jlong seconds = millis / 1000;
  millis %= 1000;
  if (seconds > 50000000) { 
    seconds = 50000000;
  }
  abstime->tv_sec = now.tv_sec  + seconds;
  long       usec = now.tv_usec + millis * 1000;
  if (usec >= 1000000) {
    abstime->tv_sec += 1;
    usec -= 1000000;
  }
  abstime->tv_nsec = usec * 1000;
  return abstime;
}
static struct timespec * compute_abstime ( struct timespec * abstime , jlong millis ) { if ( millis < 0 ) millis = 0 ; struct timeval now ; int status = gettimeofday ( & now , NULL ) ; assert ( status == 0 , " " ) ; jlong seconds = millis / 1000 ; millis %= 1000 ; if ( seconds > 50000000 ) { seconds = 50000000 ; } abstime -> tv_sec = now . tv_sec + seconds ; long usec = now . tv_usec + millis * 1000 ; if ( usec >= 1000000 ) { abstime -> tv_sec += 1 ; usec -= 1000000 ; } abstime -> tv_nsec = usec * 1000 ; return abstime ; }
utility to compute the abstime argument to timedwait:
millis is the relative timeout time
abstime will be the absolute timeout time
TODO: replace compute_abstime() with unpackTime()
utility to compute the abstime argument to timedwait : millis is the relative timeout time abstime will be the absolute timeout time TODO : replace compute_abstime () with unpackTime ()
// see man cond_timedwait(3T)