Skip to content

Commit

Permalink
[librpc] fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
gozfree committed Sep 23, 2018
1 parent 0f711c3 commit b931a01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions librpc/librpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ static void on_read(int fd, void *arg)

if (r->state == rpc_inited) {
r->send_pkt.header.uuid_src = *(uint32_t *)pkt->payload;
thread_sem_signal(r->dispatch_thread);
thread_signal(r->dispatch_thread);
r->state = rpc_connected;
} else if (r->state == rpc_connected) {
struct iovec buf;
buf.iov_len = pkt->header.payload_len;
buf.iov_base = pkt->payload;
process_msg(r, &buf);
//free(pkt->payload);
thread_sem_signal(r->dispatch_thread);
thread_signal(r->dispatch_thread);
}
}

Expand Down Expand Up @@ -313,7 +313,7 @@ struct rpc *rpc_create(const char *host, uint16_t port)
r->dispatch_thread = thread_create(rpc_dispatch_thread, r);

r->state = rpc_inited;
if (thread_sem_wait(r->dispatch_thread, 2000) == -1) {
if (thread_wait(r->dispatch_thread, 2000) == -1) {
loge("wait response failed %d:%s\n", errno, strerror(errno));
return NULL;
}
Expand Down Expand Up @@ -459,7 +459,7 @@ int rpc_call(struct rpc *r, uint32_t msg_id,
return -1;
}
if (IS_RPC_MSG_NEED_RETURN(msg_id)) {
if (thread_sem_wait(r->dispatch_thread, 2000) == -1) {
if (thread_wait(r->dispatch_thread, 2000) == -1) {
loge("wait response failed %d:%s\n", errno, strerror(errno));
return -1;
}
Expand Down

0 comments on commit b931a01

Please sign in to comment.