Changeset 3f7e1f24 in mainline for uspace/srv/sysman/unit.c
- Timestamp:
- 2019-08-03T08:28:26Z (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/unit.c
rd7c5fc0 r3f7e1f24 68 68 69 69 unit->state = STATE_EMBRYO; 70 fibril_mutex_initialize(&unit->state_mtx);71 fibril_condvar_initialize(&unit->state_cv);72 70 73 71 list_initialize(&unit->dependants); … … 105 103 } 106 104 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 }114 105 115 106 /** Issue request to restarter to start a unit 116 107 * 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) 119 116 */ 120 117 int unit_start(unit_t *unit)
Note:
See TracChangeset
for help on using the changeset viewer.