Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 50f19b7 in mainline


Ignore:
Timestamp:
2018-01-13T08:42:30Z (4 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master
Children:
18bb198, a0a9cc2
Parents:
a53ed3a (diff), 6a5d05b (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-01-13 08:42:30)
git-committer:
GitHub <noreply@…> (2018-01-13 08:42:30)
Message:

Merge pull request #14 from Aearsis/master

async_usleep: no need to use a heap-allocated amsg_t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    ra53ed3a r50f19b7  
    18561856void async_usleep(suseconds_t timeout)
    18571857{
    1858         amsg_t *msg = amsg_create();
    1859         if (!msg)
    1860                 return;
    1861        
    1862         msg->wdata.fid = fibril_get_id();
    1863        
    1864         getuptime(&msg->wdata.to_event.expires);
    1865         tv_add_diff(&msg->wdata.to_event.expires, timeout);
     1858        awaiter_t awaiter;
     1859        awaiter_initialize(&awaiter);
     1860       
     1861        awaiter.fid = fibril_get_id();
     1862       
     1863        getuptime(&awaiter.to_event.expires);
     1864        tv_add_diff(&awaiter.to_event.expires, timeout);
    18661865       
    18671866        futex_down(&async_futex);
    18681867       
    1869         async_insert_timeout(&msg->wdata);
     1868        async_insert_timeout(&awaiter);
    18701869       
    18711870        /* Leave the async_futex locked when entering this function */
     
    18731872       
    18741873        /* Futex is up automatically after fibril_switch() */
    1875        
    1876         amsg_destroy(msg);
    18771874}
    18781875
Note: See TracChangeset for help on using the changeset viewer.