Changeset b7068da in mainline for uspace/lib/usbdev/src/recognise.c


Ignore:
Timestamp:
2012-02-09T20:35:12Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591762c6
Parents:
7cede12c (diff), 3d4750f (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:

Merge mainline changes

File:
1 edited

Legend:

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

    r7cede12c rb7068da  
    4545#include <errno.h>
    4646#include <assert.h>
    47 
    48 /** Index to append after device name for uniqueness. */
    49 static size_t device_name_index = 0;
    50 /** Mutex guard for device_name_index. */
    51 static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
    5247
    5348/** DDF operations of child devices. */
     
    329324        }
    330325
    331         fibril_mutex_lock(&device_name_index_mutex);
    332         const size_t this_device_name_index = device_name_index++;
    333         fibril_mutex_unlock(&device_name_index_mutex);
     326        /** Index to append after device name for uniqueness. */
     327        static atomic_t device_name_index = {0};
     328        const size_t this_device_name_index =
     329            (size_t) atomic_preinc(&device_name_index);
    334330
    335331        ddf_fun_t *child = NULL;
Note: See TracChangeset for help on using the changeset viewer.