Changeset 1dec7cb in mainline


Ignore:
Timestamp:
2012-08-23T18:25:06Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
92e963f
Parents:
4b640a2
Message:

Use lock/unlock naming

Location:
uspace/srv/logger
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/logger/ctl.c

    r4b640a2 r1dec7cb  
    5151        }
    5252
    53         logger_log_t *log = find_log_by_name_and_acquire(full_name);
     53        logger_log_t *log = find_log_by_name_and_lock(full_name);
    5454        free(full_name);
    5555        if (log == NULL)
     
    5858        log->logged_level = new_level;
    5959
    60         log_release(log);
     60        log_unlock(log);
    6161
    6262        return EOK;
  • uspace/srv/logger/initlvl.c

    r4b640a2 r1dec7cb  
    6262                return;
    6363
    64         logger_log_t *log = find_or_create_log_and_acquire(key, 0);
     64        logger_log_t *log = find_or_create_log_and_lock(key, 0);
    6565        if (log == NULL)
    6666                return;
     
    6868        log->logged_level = level;
    6969
    70         log_release(log);
     70        log_unlock(log);
    7171}
    7272
  • uspace/srv/logger/logger.h

    r4b640a2 r1dec7cb  
    6868};
    6969
    70 logger_log_t *find_log_by_name_and_acquire(const char *name);
    71 logger_log_t *find_or_create_log_and_acquire(const char *, sysarg_t);
    72 logger_log_t *find_log_by_id_and_acquire(sysarg_t);
     70logger_log_t *find_log_by_name_and_lock(const char *name);
     71logger_log_t *find_or_create_log_and_lock(const char *, sysarg_t);
     72logger_log_t *find_log_by_id_and_lock(sysarg_t);
    7373bool shall_log_message(logger_log_t *, log_level_t);
    74 void log_release(logger_log_t *);
     74void log_unlock(logger_log_t *);
    7575void write_to_log(logger_log_t *, log_level_t, const char *);
    7676
  • uspace/srv/logger/logs.c

    r4b640a2 r1dec7cb  
    115115}
    116116
    117 logger_log_t *find_or_create_log_and_acquire(const char *name, sysarg_t parent_id)
     117logger_log_t *find_or_create_log_and_lock(const char *name, sysarg_t parent_id)
    118118{
    119119        logger_log_t *result = NULL;
     
    139139}
    140140
    141 logger_log_t *find_log_by_name_and_acquire(const char *name)
     141logger_log_t *find_log_by_name_and_lock(const char *name)
    142142{
    143143        logger_log_t *result = NULL;
     
    157157}
    158158
    159 logger_log_t *find_log_by_id_and_acquire(sysarg_t id)
     159logger_log_t *find_log_by_id_and_lock(sysarg_t id)
    160160{
    161161        logger_log_t *result = NULL;
     
    195195}
    196196
    197 void log_release(logger_log_t *log)
     197void log_unlock(logger_log_t *log)
    198198{
    199199        assert(fibril_mutex_is_locked(&log->guard));
  • uspace/srv/logger/writer.c

    r4b640a2 r1dec7cb  
    5656                return NULL;
    5757
    58         logger_log_t *log = find_or_create_log_and_acquire(name, parent);
     58        logger_log_t *log = find_or_create_log_and_lock(name, parent);
    5959
    6060        free(name);
     
    6565static int handle_receive_message(sysarg_t log_id, sysarg_t level)
    6666{
    67         logger_log_t *log = find_log_by_id_and_acquire(log_id);
     67        logger_log_t *log = find_log_by_id_and_lock(log_id);
    6868        if (log == NULL)
    6969                return ENOENT;
     
    8787
    8888leave:
    89         log_release(log);
     89        log_unlock(log);
    9090        free(message);
    9191
     
    114114                                break;
    115115                        }
    116                         log_release(log);
     116                        log_unlock(log);
    117117                        async_answer_1(callid, EOK, (sysarg_t) log);
    118118                        break;
Note: See TracChangeset for help on using the changeset viewer.