Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/RISCOS/sleep.c

    r2 r391  
    1010int riscos_sleep(double delay)
    1111{
    12         os_t starttime, endtime, time; /* monotonic times (centiseconds) */
    13         int *pollword, ret;
    14         osbool claimed;
     12    os_t starttime, endtime, time; /* monotonic times (centiseconds) */
     13    int *pollword, ret;
     14    osbool claimed;
    1515
    16         /* calculate end time */
    17         starttime = os_read_monotonic_time();
    18         if (starttime + 100.0*delay >INT_MAX)
    19                 endtime = INT_MAX;
    20         else
    21                 endtime = (os_t)(starttime + 100.0*delay);
     16    /* calculate end time */
     17    starttime = os_read_monotonic_time();
     18    if (starttime + 100.0*delay >INT_MAX)
     19        endtime = INT_MAX;
     20    else
     21        endtime = (os_t)(starttime + 100.0*delay);
    2222
    23         /* allocate (in RMA) and set pollword for xupcall_sleep */
    24         pollword = osmodule_alloc(4);
    25         *pollword = 1;
     23    /* allocate (in RMA) and set pollword for xupcall_sleep */
     24    pollword = osmodule_alloc(4);
     25    *pollword = 1;
    2626
    27         time = starttime;
    28         ret = 0;
    29         while ( time<endtime && time>=starttime ) {
    30                 xupcall_sleep (pollword, &claimed);
    31                 if (PyErr_CheckSignals()) {
    32                         ret = 1;
    33                         break;
    34                 }
    35                 time = os_read_monotonic_time();
    36         }
     27    time = starttime;
     28    ret = 0;
     29    while ( time<endtime && time>=starttime ) {
     30        xupcall_sleep (pollword, &claimed);
     31        if (PyErr_CheckSignals()) {
     32            ret = 1;
     33            break;
     34        }
     35        time = os_read_monotonic_time();
     36    }
    3737
    38         /* deallocate pollword */
    39         osmodule_free(pollword);
    40         return ret;
     38    /* deallocate pollword */
     39    osmodule_free(pollword);
     40    return ret;
    4141}
Note: See TracChangeset for help on using the changeset viewer.