static int __is_pkg_supported(char *pkgtype);
queue_info_map *start = NULL;
-pthread_mutex_t pm_mutex;
int entries = 0;
int slot = 0;
int num_of_backends = 0;
}
free(namelist);
num_of_backends = slot;
- pthread_mutex_init(&pm_mutex, NULL);
#ifdef DEBUG_INFO
/*Debug info*/
if (ret == 0)
return -1;
- pthread_mutex_lock(&pm_mutex);
cur = __get_head_from_pkgtype(item);
tmp = cur;
data = _add_node();
if (!data) { /* fail to allocate mem */
ERR("Fail to allocate memory\n");
- pthread_mutex_unlock(&pm_mutex);
return -1;
}
tmp->next = data;
}
- pthread_mutex_unlock(&pm_mutex);
return 0;
}
return NULL;
}
memset(ret, 0x00, sizeof(pm_dbus_msg));
- pthread_mutex_lock(&pm_mutex);
ptr = start;
for(i = 0; i < entries; i++)
{
if (!cur) { /* queue is empty */
ret->req_type = -1;
- pthread_mutex_unlock(&pm_mutex);
return ret;
}
}
ptr++;
}
- pthread_mutex_unlock(&pm_mutex);
return ret;
}