Changeset 1dec7cb in mainline
- Timestamp:
- 2012-08-23T18:25:06Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 92e963f
- Parents:
- 4b640a2
- Location:
- uspace/srv/logger
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/logger/ctl.c
r4b640a2 r1dec7cb 51 51 } 52 52 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); 54 54 free(full_name); 55 55 if (log == NULL) … … 58 58 log->logged_level = new_level; 59 59 60 log_ release(log);60 log_unlock(log); 61 61 62 62 return EOK; -
uspace/srv/logger/initlvl.c
r4b640a2 r1dec7cb 62 62 return; 63 63 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); 65 65 if (log == NULL) 66 66 return; … … 68 68 log->logged_level = level; 69 69 70 log_ release(log);70 log_unlock(log); 71 71 } 72 72 -
uspace/srv/logger/logger.h
r4b640a2 r1dec7cb 68 68 }; 69 69 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);70 logger_log_t *find_log_by_name_and_lock(const char *name); 71 logger_log_t *find_or_create_log_and_lock(const char *, sysarg_t); 72 logger_log_t *find_log_by_id_and_lock(sysarg_t); 73 73 bool shall_log_message(logger_log_t *, log_level_t); 74 void log_ release(logger_log_t *);74 void log_unlock(logger_log_t *); 75 75 void write_to_log(logger_log_t *, log_level_t, const char *); 76 76 -
uspace/srv/logger/logs.c
r4b640a2 r1dec7cb 115 115 } 116 116 117 logger_log_t *find_or_create_log_and_ acquire(const char *name, sysarg_t parent_id)117 logger_log_t *find_or_create_log_and_lock(const char *name, sysarg_t parent_id) 118 118 { 119 119 logger_log_t *result = NULL; … … 139 139 } 140 140 141 logger_log_t *find_log_by_name_and_ acquire(const char *name)141 logger_log_t *find_log_by_name_and_lock(const char *name) 142 142 { 143 143 logger_log_t *result = NULL; … … 157 157 } 158 158 159 logger_log_t *find_log_by_id_and_ acquire(sysarg_t id)159 logger_log_t *find_log_by_id_and_lock(sysarg_t id) 160 160 { 161 161 logger_log_t *result = NULL; … … 195 195 } 196 196 197 void log_ release(logger_log_t *log)197 void log_unlock(logger_log_t *log) 198 198 { 199 199 assert(fibril_mutex_is_locked(&log->guard)); -
uspace/srv/logger/writer.c
r4b640a2 r1dec7cb 56 56 return NULL; 57 57 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); 59 59 60 60 free(name); … … 65 65 static int handle_receive_message(sysarg_t log_id, sysarg_t level) 66 66 { 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); 68 68 if (log == NULL) 69 69 return ENOENT; … … 87 87 88 88 leave: 89 log_ release(log);89 log_unlock(log); 90 90 free(message); 91 91 … … 114 114 break; 115 115 } 116 log_ release(log);116 log_unlock(log); 117 117 async_answer_1(callid, EOK, (sysarg_t) log); 118 118 break;
Note:
See TracChangeset
for help on using the changeset viewer.