Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2edcb63 in mainline


Ignore:
Timestamp:
2010-11-30T15:16:05Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
398c4d7
Parents:
703d19c
Message:

Bugfixes in devman

First fix: the passing the devices to driver is even more careful on
variables that might be touch from more fibrils.

Second fix: add missing iterator incrementation when adding device to
class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r703d19c r2edcb63  
    540540
    541541                /*
     542                 * We remove the device from the list to allow safe adding
     543                 * of new devices (no one will touch our item this way).
     544                 */
     545                list_remove(link);
     546
     547                /*
    542548                 * Unlock to avoid deadlock when adding device
    543549                 * handled by itself.
     
    552558                 */
    553559                fibril_mutex_lock(&driver->driver_mutex);
     560
     561                /*
     562                 * Insert the device back.
     563                 * The order is not relevant here so no harm is done
     564                 * (actually, the order would be preserved in most cases).
     565                 */
     566                list_append(link, &driver->devices);
    554567
    555568                /*
     
    11331146        while (link != &class_list->classes) {
    11341147                cl = list_get_instance(link, dev_class_t, link);
    1135                 if (str_cmp(cl->name, class_name) == 0)
     1148                if (str_cmp(cl->name, class_name) == 0) {
    11361149                        return cl;
     1150                }
     1151                link = link->next;
    11371152        }
    11381153       
Note: See TracChangeset for help on using the changeset viewer.