mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-10 07:35:34 +00:00
ipc: add a non-blocking send function.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
e163121d02
commit
74a7a49354
@ -79,6 +79,12 @@ qb_ipcc_dispatch_flow_control_get (
|
||||
qb_hdb_handle_t handle,
|
||||
unsigned int *flow_control_state);
|
||||
|
||||
extern int32_t
|
||||
qb_ipcc_msg_send (
|
||||
qb_hdb_handle_t handle,
|
||||
const struct iovec *iov,
|
||||
unsigned int iov_len);
|
||||
|
||||
extern int32_t
|
||||
qb_ipcc_msg_send_reply_receive (
|
||||
qb_hdb_handle_t handle,
|
||||
|
||||
28
lib/ipcc.c
28
lib/ipcc.c
@ -998,6 +998,34 @@ error_exit:
|
||||
return (res);
|
||||
}
|
||||
|
||||
int32_t
|
||||
qb_ipcc_msg_send (
|
||||
qb_hdb_handle_t handle,
|
||||
const struct iovec *iov,
|
||||
unsigned int iov_len)
|
||||
{
|
||||
int32_t res;
|
||||
struct ipc_instance *ipc_instance;
|
||||
|
||||
res = qb_hdb_handle_get (&ipc_hdb, handle, (void **)&ipc_instance);
|
||||
if (res != 0) {
|
||||
return (res);
|
||||
}
|
||||
|
||||
pthread_mutex_lock (&ipc_instance->mutex);
|
||||
|
||||
res = msg_send (ipc_instance, iov, iov_len);
|
||||
if (res != 0) {
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
error_exit:
|
||||
qb_hdb_handle_put (&ipc_hdb, handle);
|
||||
pthread_mutex_unlock (&ipc_instance->mutex);
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
int32_t
|
||||
qb_ipcc_msg_send_reply_receive (
|
||||
qb_hdb_handle_t handle,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user