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


Ignore:
Timestamp:
2019-08-03T08:28:26Z (6 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/unit.c

    rd7c5fc0 r3f7e1f24  
    6868
    6969        unit->state = STATE_EMBRYO;
    70         fibril_mutex_initialize(&unit->state_mtx);
    71         fibril_condvar_initialize(&unit->state_cv);
    7270
    7371        list_initialize(&unit->dependants);
     
    105103}
    106104
    107 void unit_set_state(unit_t *unit, unit_state_t state)
    108 {
    109         fibril_mutex_lock(&unit->state_mtx);
    110         unit->state = state;
    111         fibril_condvar_broadcast(&unit->state_cv);
    112         fibril_mutex_unlock(&unit->state_mtx);
    113 }
    114105
    115106/** Issue request to restarter to start a unit
    116107 *
    117  * Return from this function only means start request was issued.
    118  * If you need to wait for real start of the unit, use waiting on state_cv.
     108 * Ideally this function is non-blocking synchronous, however, some units
     109 * cannot be started synchronously and thus return from this function generally
     110 * means that start was requested.
     111 *
     112 * Check state of the unit for actual result, start method can end in states:
     113 *   - STATE_STARTED, (succesful synchronous start)
     114 *   - STATE_STARTING, (succesful asynchronous start request)
     115 *   - STATE_FAILED.  (error occured)
    119116 */
    120117int unit_start(unit_t *unit)
Note: See TracChangeset for help on using the changeset viewer.