Changeset 01b8c2e4 in mainline
- Timestamp:
- 2012-07-16T15:43:27Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be73793
- Parents:
- ceafd1b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/logger/namespace.c
rceafd1b r01b8c2e4 90 90 } 91 91 92 logging_namespace_t *namespace_create(const char *name) 93 { 94 fibril_mutex_lock(&namespace_list_guard); 92 static logging_namespace_t *namespace_create_no_lock(const char *name) 93 { 95 94 logging_namespace_t *existing = namespace_find_no_lock(name); 96 95 if (existing != NULL) { 97 fibril_mutex_unlock(&namespace_list_guard);98 96 return NULL; 99 97 } … … 101 99 logging_namespace_t *namespace = malloc(sizeof(logging_namespace_t)); 102 100 if (namespace == NULL) { 103 fibril_mutex_unlock(&namespace_list_guard);104 101 return NULL; 105 102 } … … 107 104 namespace->name = str_dup(name); 108 105 if (namespace->name == NULL) { 109 fibril_mutex_unlock(&namespace_list_guard);110 106 free(namespace); 111 107 return NULL; … … 119 115 120 116 list_append(&namespace->link, &namespace_list); 121 fibril_mutex_unlock(&namespace_list_guard);122 117 123 118 return namespace; 119 } 120 121 122 logging_namespace_t *namespace_create(const char *name) 123 { 124 fibril_mutex_lock(&namespace_list_guard); 125 logging_namespace_t *result = namespace_create_no_lock(name); 126 fibril_mutex_unlock(&namespace_list_guard); 127 return result; 124 128 } 125 129 … … 186 190 187 191 if (namespace == NULL) { 188 namespace = namespace_create (name);192 namespace = namespace_create_no_lock(name); 189 193 } 190 194
Note:
See TracChangeset
for help on using the changeset viewer.