Ignore:
Timestamp:
2018-08-25T21:35:26Z (6 years ago)
Author:
GitHub <noreply@…>
Parents:
e2625b1a (diff), 3c45353 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermář <jakub@…> (2018-08-25 21:35:26)
git-committer:
GitHub <noreply@…> (2018-08-25 21:35:26)
Message:

Merge 3c453534a2b093c8039d8e8059b923c71f3492a3 into e2625b1a1e5a2895b86f0e39c2d70a39e49e042a

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/thread/fibril_synch.c

    re2625b1a r231b3fd  
    3737#include <async.h>
    3838#include <adt/list.h>
    39 #include <sys/time.h>
     39#include <time.h>
    4040#include <errno.h>
    4141#include <assert.h>
     
    390390errno_t
    391391fibril_condvar_wait_timeout(fibril_condvar_t *fcv, fibril_mutex_t *fm,
    392     suseconds_t timeout)
     392    usec_t timeout)
    393393{
    394394        assert(fibril_mutex_is_locked(fm));
     
    400400        wdata.mutex = fm;
    401401
    402         struct timeval tv;
    403         struct timeval *expires = NULL;
     402        struct timespec ts;
     403        struct timespec *expires = NULL;
    404404        if (timeout) {
    405                 getuptime(&tv);
    406                 tv_add_diff(&tv, timeout);
    407                 expires = &tv;
     405                getuptime(&ts);
     406                ts_add_diff(&ts, USEC2NSEC(timeout));
     407                expires = &ts;
    408408        }
    409409
     
    557557 * @param arg           Argument for @a fun
    558558 */
    559 void fibril_timer_set(fibril_timer_t *timer, suseconds_t delay,
     559void fibril_timer_set(fibril_timer_t *timer, usec_t delay,
    560560    fibril_timer_fun_t fun, void *arg)
    561561{
     
    575575 * @param arg           Argument for @a fun
    576576 */
    577 void fibril_timer_set_locked(fibril_timer_t *timer, suseconds_t delay,
     577void fibril_timer_set_locked(fibril_timer_t *timer, usec_t delay,
    578578    fibril_timer_fun_t fun, void *arg)
    579579{
     
    728728}
    729729
    730 errno_t fibril_semaphore_down_timeout(fibril_semaphore_t *sem, suseconds_t timeout)
     730errno_t fibril_semaphore_down_timeout(fibril_semaphore_t *sem, usec_t timeout)
    731731{
    732732        if (timeout < 0)
     
    751751        futex_unlock(&fibril_synch_futex);
    752752
    753         struct timeval tv;
    754         struct timeval *expires = NULL;
     753        struct timespec ts;
     754        struct timespec *expires = NULL;
    755755        if (timeout) {
    756                 getuptime(&tv);
    757                 tv_add_diff(&tv, timeout);
    758                 expires = &tv;
     756                getuptime(&ts);
     757                ts_add_diff(&ts, USEC2NSEC(timeout));
     758                expires = &ts;
    759759        }
    760760
Note: See TracChangeset for help on using the changeset viewer.