Changeset dba056b in mainline for uspace/srv/sysman/sysman.c


Ignore:
Timestamp:
2019-08-06T19:23:56Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
c6d87c10
Parents:
3f05ef7
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-06-20 01:04:31)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 19:23:56)
Message:

sysman: Using exposees to detect asynchronous start

  • also fixed bug with reference counting of merged jobs
  • add test for the faulty behavior
File:
1 edited

Legend:

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

    r3f05ef7 rdba056b  
    196196/** Create and queue job for unit
    197197 *
    198  * If unit already has the same job assigned callback is set to it.
     198 * If unit already has the same job assigned callback is moved to it.
    199199 *
    200200 * @param[in]  callback  (optional) callback must explicitly delete reference
     
    213213        if (callback != NULL) {
    214214                job_add_ref(job);
     215                //TODO sysman_object_observer is not fibril-safe CANNOT BE CALLED HERE!
    215216                sysman_object_observer(job, callback, callback_arg);
    216217        }
     
    328329}
    329330
     331size_t sysman_observers_count(void *object)
     332{
     333        ht_link_t *ht_link = hash_table_find(&observed_objects, &object);
     334
     335        if (ht_link == NULL) {
     336                return 0;
     337        }
     338
     339        observed_object_t *observed_object =
     340            hash_table_get_inst(ht_link, observed_object_t, ht_link);
     341
     342        return list_count(&observed_object->callbacks);
     343}
     344
    330345
    331346/*
     
    355370                goto fail;
    356371        }
     372
    357373        /* We don't need job anymore */
    358374        job_del_ref(&job);
Note: See TracChangeset for help on using the changeset viewer.