Changeset 7bd34e5 in mainline for uspace/drv/uhci/utils/hc_synchronizer.c
- Timestamp:
- 2011-01-07T14:40:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 8324b65
- Parents:
- 92f924c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/utils/hc_synchronizer.c
r92f924c8 r7bd34e5 1 1 #include "hc_synchronizer.h" 2 2 3 void sync_init(sync_value_t *value) 4 { 5 assert(value); 6 fibril_semaphore_initialize(&value->done, 0); 7 } 8 /*----------------------------------------------------------------------------*/ 3 9 void sync_wait_for(sync_value_t *value) 4 10 { 5 11 assert( value ); 6 value->waiting_fibril = fibril_get_id(); 7 uhci_print_verbose("turning off fibril %p.\n", value->waiting_fibril); 8 fibril_switch(FIBRIL_TO_MANAGER); 12 fibril_semaphore_down(&value->done); 9 13 } 10 14 /*----------------------------------------------------------------------------*/ … … 16 20 value->size = size; 17 21 value->result = result; 18 fibril_ add_ready(value->waiting_fibril);22 fibril_semaphore_up(&value->done); 19 23 } 20 24 /*----------------------------------------------------------------------------*/ … … 25 29 assert(value); 26 30 value->result = result; 27 uhci_print_verbose("resuming fibril %p.\n", value->waiting_fibril); 28 fibril_add_ready(value->waiting_fibril); 31 fibril_semaphore_up(&value->done); 29 32 }
Note:
See TracChangeset
for help on using the changeset viewer.