int fd;
pid_t pid;
uid_t uid;
- GRecMutex mutex;
} client_channel_t;
struct aul_request_s {
static void __destroy_client_channel(gpointer data)
{
client_channel_t *channel = data;
-
- g_rec_mutex_lock(&channel->mutex);
- g_rec_mutex_unlock(&channel->mutex);
- g_rec_mutex_clear(&channel->mutex);
-
free(channel);
}
return NULL;
}
- g_rec_mutex_init(&channel->mutex);
-
channel->fd = fd;
channel->pid = pid;
channel->uid = uid;
int ret;
if (req->cmd != WIDGET_GET_CONTENT && req->clifd >= 0) {
+ g_rec_mutex_lock(&__context.mutex);
if (__find_client_channel(req->clifd) == NULL)
_E("Failed to find client channel. fd(%d)", req->clifd);
ret = aul_sock_send_result_v2(req->clifd, res, false);
+ g_rec_mutex_unlock(&__context.mutex);
if (ret < 0) {
_E("Failed to send result. cmd(%s:%d)",
aul_cmd_convert_to_string(req->cmd),
app_pkt_t *pkt;
int ret;
+ g_rec_mutex_lock(&__context.mutex);
channel = __find_client_channel(fd);
if (!channel) {
_E("Failed to find client channel. fd(%d)", fd);
+ g_rec_mutex_unlock(&__context.mutex);
return false;
}
aul_worker_remove_io_job(worker, fd);
__remove_client_channel(channel);
__destroy_client_channel(channel);
+ g_rec_mutex_unlock(&__context.mutex);
return true;
}
- g_rec_mutex_lock(&channel->mutex);
ret = aul_sock_recv_reply_pkt_v2(fd, &pkt, false);
- g_rec_mutex_unlock(&channel->mutex);
+ g_rec_mutex_unlock(&__context.mutex);
if (ret != 0) {
_E("Failed to receive the packet. error(%d)", ret);
return true;