Changeset 458e40c in mainline for uspace/lib/usb/src/recognise.c


Ignore:
Timestamp:
2011-02-04T14:26:40Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
400575c5, 89acf204
Parents:
bfc12ef (diff), 6f8f808 (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.
Message:

Merged minor fixes and improvements

See log messages of merged revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/recognise.c

    rbfc12ef r458e40c  
    359359{
    360360        static size_t device_name_index = 0;
     361        static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
     362
     363        size_t this_device_name_index;
     364
     365        fibril_mutex_lock(&device_name_index_mutex);
     366        this_device_name_index = device_name_index;
     367        device_name_index++;
     368        fibril_mutex_unlock(&device_name_index_mutex);
     369
    361370
    362371        device_t *child = NULL;
     
    374383         * naming etc., something more descriptive could be created.
    375384         */
    376         rc = asprintf(&child_name, "usbdev%02zu", device_name_index);
     385        rc = asprintf(&child_name, "usbdev%02zu", this_device_name_index);
    377386        if (rc < 0) {
    378387                goto failure;
     
    396405        }
    397406       
    398         device_name_index++;
    399 
    400407        return EOK;
    401408
Note: See TracChangeset for help on using the changeset viewer.