}
/* search from cache */
- if (!g_queue_is_empty(module->cache)) {
- pthread_mutex_lock(&(module->cache_mutex));
- g_queue_foreach(module->cache, (GFunc)logging_cache_search, (gpointer)&search);
- pthread_mutex_unlock(&(module->cache_mutex));
- }
+ pthread_mutex_lock(&(module->cache_mutex));
+ g_queue_foreach(module->cache, (GFunc)logging_cache_search, (gpointer)&search);
+ pthread_mutex_unlock(&(module->cache_mutex));
return RESOURCED_ERROR_NONE;
}
}
/* Modify cache */
- if (!g_queue_is_empty(module->cache)) {
- pthread_mutex_lock(&(module->cache_mutex));
- for (i = 0; i < g_queue_get_length(module->cache); i++) {
- entry = (struct logging_table_form *)g_queue_peek_nth(
- module->cache, i);
- if (entry->uid == uid && !strncmp(entry->appid, old_appid, strlen(old_appid)))
- snprintf(entry->appid, MAX_APPID_LENGTH, "%s", new_appid);
- }
- pthread_mutex_unlock(&(module->cache_mutex));
+ pthread_mutex_lock(&(module->cache_mutex));
+ for (i = 0; i < g_queue_get_length(module->cache); i++) {
+ entry = (struct logging_table_form *)g_queue_peek_nth(
+ module->cache, i);
+ if (entry->uid == uid && !strncmp(entry->appid, old_appid, strlen(old_appid)))
+ snprintf(entry->appid, MAX_APPID_LENGTH, "%s", new_appid);
}
+ pthread_mutex_unlock(&(module->cache_mutex));
/* Modify DB */
switch (module->db_type) {