Changeset 9a884ed in mainline for uspace/app/vuhid/device.c
- Timestamp:
- 2011-05-06T10:12:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42d47f8
- Parents:
- 30f9f8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/device.c
r30f9f8f r9a884ed 77 77 { 78 78 vuhid_interface_t *iface = arg; 79 vuhid_data_t *hid_data = iface->vuhid_data; 79 80 80 81 if (iface->live != NULL) { 81 82 iface->live(iface); 82 83 } 84 85 fibril_mutex_lock(&hid_data->iface_count_mutex); 86 hid_data->iface_died_count++; 87 fibril_condvar_broadcast(&hid_data->iface_count_cv); 88 fibril_mutex_unlock(&hid_data->iface_count_mutex); 83 89 84 90 return EOK; … … 110 116 if ((iface->in_data_size == 0) && (iface->out_data_size == 0)) { 111 117 return EEMPTY; 118 } 119 120 // FIXME - we shall set vuhid_data to NULL in the main() rather 121 // than to depend on individual interfaces 122 /* Already used interface. */ 123 if (iface->vuhid_data != NULL) { 124 return EEXISTS; 112 125 } 113 126 … … 252 265 253 266 /* Launch the "life" fibril. */ 267 iface->vuhid_data = hid_data; 254 268 fid_t life_fibril = fibril_create(interface_life_fibril, iface); 255 269 if (life_fibril == 0) { … … 310 324 += total_descr_size; 311 325 326 hid_data->iface_count++; 312 327 fibril_add_ready(life_fibril); 313 328 … … 331 346 } 332 347 348 void wait_for_interfaces_death(usbvirt_device_t *dev) 349 { 350 vuhid_data_t *hid_data = dev->device_data; 351 352 fibril_mutex_lock(&hid_data->iface_count_mutex); 353 while (hid_data->iface_died_count < hid_data->iface_count) { 354 fibril_condvar_wait(&hid_data->iface_count_cv, 355 &hid_data->iface_count_mutex); 356 } 357 fibril_mutex_unlock(&hid_data->iface_count_mutex); 358 } 333 359 334 360 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.