Changeset 3f7e1f24 in mainline for uspace/srv/sysman/configuration.c


Ignore:
Timestamp:
2019-08-03T08:28:26Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
095d03c
Parents:
d7c5fc0
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-04-22 17:54:08)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-03 08:28:26)
Message:

sysman: Refactored job manipulation (event loop + one main fibril)

File:
1 edited

Legend:

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

    rd7c5fc0 r3f7e1f24  
    3939
    4040static hash_table_t units;
    41 static fibril_rwlock_t units_rwl;
    4241
    4342/* Hash table functions */
     
    8180{
    8281        hash_table_create(&units, 0, 0, &units_ht_ops);
    83         fibril_rwlock_initialize(&units_rwl);
    8482}
    8583
     
    8987        assert(unit->state == STATE_EMBRYO);
    9088        assert(unit->name != NULL);
    91         assert(fibril_rwlock_is_write_locked(&units_rwl));
    9289        sysman_log(LVL_DEBUG2, "%s('%s')", __func__, unit_name(unit));
    9390
     
    10097
    10198void configuration_start_update(void) {
    102         assert(!fibril_rwlock_is_write_locked(&units_rwl));
    103         sysman_log(LVL_DEBUG2, "%s", __func__);
    104         fibril_rwlock_write_lock(&units_rwl);
     99        sysman_log(LVL_DEBUG2, "%s", __func__);
    105100}
    106101
     
    124119void configuration_commit(void)
    125120{
    126         assert(fibril_rwlock_is_write_locked(&units_rwl));
    127121        sysman_log(LVL_DEBUG2, "%s", __func__);
    128122
     
    132126         */
    133127        hash_table_apply(&units, &configuration_commit_unit, NULL);
    134         fibril_rwlock_write_unlock(&units_rwl);
    135128}
    136129
     
    157150void configuration_rollback(void)
    158151{
    159         assert(fibril_rwlock_is_write_locked(&units_rwl));
    160152        sysman_log(LVL_DEBUG2, "%s", __func__);
    161153
    162154        hash_table_apply(&units, &configuration_rollback_unit, NULL);
    163         fibril_rwlock_write_unlock(&units_rwl);
    164155}
    165156
     
    199190int configuration_resolve_dependecies(void)
    200191{
    201         assert(fibril_rwlock_is_write_locked(&units_rwl));
    202192        sysman_log(LVL_DEBUG2, "%s", __func__);
    203193
Note: See TracChangeset for help on using the changeset viewer.