Changeset 127c20e in rtems for cpukit/posix/src/condtimedwait.c


Ignore:
Timestamp:
Jun 23, 2016, 8:10:39 PM (4 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
master
Children:
b5bfaaf9
Parents:
10e4000
git-author:
Gedare Bloom <gedare@…> (06/23/16 20:10:39)
git-committer:
Gedare Bloom <gedare@…> (07/25/16 16:44:47)
Message:

posix: refactor cond wait support to defer abstime conversion

updates #2745

File:
1 edited

Legend:

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

    r10e4000 r127c20e  
    3232)
    3333{
    34   Watchdog_Interval                            ticks;
    35   bool                                         already_timedout;
    36   TOD_Absolute_timeout_conversion_results  status;
    37 
    38   /*
    39    *  POSIX requires that blocking calls with timeouts that take
    40    *  an absolute timeout must ignore issues with the absolute
    41    *  time provided if the operation would otherwise succeed.
    42    *  So we check the abstime provided, and hold on to whether it
    43    *  is valid or not.  If it isn't correct and in the future,
    44    *  then we do a polling operation and convert the UNSATISFIED
    45    *  status into the appropriate error.
    46    */
    47   already_timedout = false;
    48   status = _TOD_Absolute_timeout_to_ticks(abstime, &ticks);
    49   if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID )
    50     return EINVAL;
    51 
    52   if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
    53        status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
    54     already_timedout = true;
    55 
    5634  return _POSIX_Condition_variables_Wait_support(
    5735    cond,
    5836    mutex,
    59     ticks,
    60     already_timedout
     37    abstime
    6138  );
    6239}
Note: See TracChangeset for help on using the changeset viewer.