Ignore:
File:
1 edited

Legend:

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

    r6e3c005 r37e4025  
    4545#include <errno.h>
    4646#include <assert.h>
     47
     48/** Index to append after device name for uniqueness. */
     49static size_t device_name_index = 0;
     50/** Mutex guard for device_name_index. */
     51static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
    4752
    4853/** DDF operations of child devices. */
     
    324329        }
    325330
    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);
     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);
    330334
    331335        ddf_fun_t *child = NULL;
Note: See TracChangeset for help on using the changeset viewer.