Changeset 3e81d52 in rtems for cpukit/posix


Ignore:
Timestamp:
Oct 29, 2017, 7:29:05 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
a54d10d
Parents:
8c1f4064
git-author:
Sebastian Huber <sebastian.huber@…> (10/29/17 19:29:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/17 13:08:32)
Message:

posix: Use far future for very long timeouts

Close #3205.

Location:
cpukit/posix/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/nanosleep.c

    r8c1f4064 r3e81d52  
    6464{
    6565  Thread_queue_Context   queue_context;
    66   struct timespec        spare_end;
     66  struct timespec        uptime;
    6767  const struct timespec *end;
    6868  Thread_Control        *executing;
     
    9494    }
    9595  } else {
    96     if ( !_Watchdog_Is_valid_interval_timespec( rqtp ) ) {
    97       return EINVAL;
    98     }
    99 
    100     _TOD_Get_zero_based_uptime_as_timespec( &spare_end );
    101 
    102     /* In case this overflows, then the enqueue callout will reject it */
    103     _Timespec_Add_to( &spare_end, rqtp );
    104 
    105     end = &spare_end;
     96    _TOD_Get_zero_based_uptime_as_timespec( &uptime );
     97    end = _Watchdog_Future_timespec( &uptime, rqtp );
    10698    _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
    10799      &queue_context,
  • cpukit/posix/src/sigtimedwait.c

    r8c1f4064 r3e81d52  
    7777  siginfo_t            *the_info;
    7878  int                   signo;
     79  struct timespec       uptime;
    7980  Thread_queue_Context  queue_context;
    8081  int                   error;
     
    9394
    9495  if ( timeout != NULL ) {
    95     struct timespec end;
    96 
    97     if ( !_Watchdog_Is_valid_interval_timespec( timeout ) ) {
    98       return EINVAL;
    99     }
    100 
    101     _TOD_Get_zero_based_uptime_as_timespec( &end );
    102 
    103     /* In case this overflows, then the enqueue callout will reject it */
    104     _Timespec_Add_to( &end, timeout );
    105 
     96    const struct timespec *end;
     97
     98    _TOD_Get_zero_based_uptime_as_timespec( &uptime );
     99    end = _Watchdog_Future_timespec( &uptime, timeout );
    106100    _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
    107101      &queue_context,
    108       &end
     102      end
    109103    );
    110104  } else {
Note: See TracChangeset for help on using the changeset viewer.