Changeset ff20afc in mainline for uspace/srv/sysman/connection_ctl.c


Ignore:
Timestamp:
2019-08-17T13:12:47Z (7 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
5a88d87
Parents:
d5cca04
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-12-04 13:56:42)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-17 13:12:47)
Message:

sysman: Synchronize access to unit repository from other fibrils

File:
1 edited

Legend:

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

    rd5cca04 rff20afc  
    7676        }
    7777
    78         // TODO this is connection fibril, UNSYNCHRONIZED access to units!
    7978        unit_t *unit = repo_find_unit_by_name(unit_name);
    8079        if (unit == NULL) {
     
    107106        sysman_log(LVL_DEBUG2, "%s(%s, %x)", __func__, unit_name, flags);
    108107
    109         // TODO this is connection fibril, UNSYNCHRONIZED access to units!
    110108        unit_t *unit = repo_find_unit_by_name(unit_name);
    111109        if (unit == NULL) {
     
    148146        sysman_log(LVL_DEBUG2, "%s(%i, %x)", __func__, handle, flags);
    149147
    150         // TODO this is connection fibril, UNSYNCHRONIZED access to units!
    151148        unit_t *unit = repo_find_unit_by_handle(handle);
    152149        if (unit == NULL) {
     
    188185        size_t to_fill = size / sizeof(unit_handle_t);
    189186        size_t total = 0;
     187        repo_rlock();
    190188        list_foreach(units, units, unit_t, u) {
    191189                if (filled < to_fill) {
     
    194192                ++total;
    195193        }
     194        repo_runlock();
    196195        *act_size = total * sizeof(unit_handle_t);
    197196        return EOK;
     
    220219       
    221220       
    222         // TODO UNSYNCHRONIZED access to units!
    223221        rc = fill_handles_buffer(handles, size, &act_size);
    224222        if (rc != EOK) {
     
    246244        }
    247245       
    248         // TODO UNSYNCHRONIZED access to units!
    249246        unit_t *u = repo_find_unit_by_handle(IPC_GET_ARG1(*icall));
    250247        if (u == NULL) {
     
    262259static void sysman_unit_get_state(ipc_callid_t iid, ipc_call_t *icall)
    263260{
    264         // TODO UNSYNCHRONIZED access to units!
    265261        unit_t *u = repo_find_unit_by_handle(IPC_GET_ARG1(*icall));
    266262        if (u == NULL) {
Note: See TracChangeset for help on using the changeset viewer.