mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-05 02:33:31 +00:00
coroipcs.h cleanup.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2132 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
4bfbee7dd8
commit
589d2ae1af
@ -522,11 +522,9 @@ static void *pthread_ipc_consumer (void *conn)
|
||||
int send_ok;
|
||||
unsigned int new_message;
|
||||
|
||||
if (api->sched_priority != 0) {
|
||||
struct sched_param sched_param;
|
||||
|
||||
sched_param.sched_priority = api->sched_priority;
|
||||
res = pthread_setschedparam (conn_info->thread, SCHED_RR, &sched_param);
|
||||
if (api->sched_policy != 0) {
|
||||
res = pthread_setschedparam (conn_info->thread,
|
||||
api->sched_policy, api->sched_param);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
@ -568,7 +568,7 @@ struct sending_allowed_private_data_struct {
|
||||
static int corosync_sending_allowed (
|
||||
unsigned int service,
|
||||
unsigned int id,
|
||||
void *msg,
|
||||
const void *msg,
|
||||
void *sending_allowed_private_data)
|
||||
{
|
||||
struct sending_allowed_private_data_struct *pd =
|
||||
@ -667,6 +667,8 @@ static void corosync_poll_dispatch_modify (
|
||||
|
||||
struct coroipcs_init_state ipc_init_state = {
|
||||
.socket_name = COROSYNC_SOCKET_NAME,
|
||||
.sched_policy = SCHED_RR,
|
||||
.sched_param = &global_sched_param,
|
||||
.malloc = malloc,
|
||||
.free = free,
|
||||
.log_printf = ipc_log_printf,
|
||||
@ -964,8 +966,6 @@ int main (int argc, char **argv)
|
||||
corosync_exit_error (AIS_DONE_INIT_SERVICES);
|
||||
}
|
||||
|
||||
ipc_init_state.sched_priority = sched_priority;
|
||||
|
||||
coroipcs_ipc_init (&ipc_init_state);
|
||||
|
||||
/*
|
||||
|
@ -109,6 +109,8 @@ struct coroipcs_zc_header {
|
||||
uint64_t server_address;
|
||||
};
|
||||
|
||||
#define SOCKET_SERVICE_INIT 0xFFFFFFFF
|
||||
|
||||
#define ZC_ALLOC_HEADER 0xFFFFFFFF
|
||||
#define ZC_FREE_HEADER 0xFFFFFFFE
|
||||
#define ZC_EXECUTE_HEADER 0xFFFFFFFD
|
||||
|
@ -37,8 +37,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SOCKET_SERVICE_INIT 0xFFFFFFFF
|
||||
|
||||
struct iovec;
|
||||
|
||||
typedef int (*coroipcs_init_fn_lvalue) (void *conn);
|
||||
@ -47,7 +45,8 @@ typedef void (*coroipcs_handler_fn_lvalue) (void *conn, const void *msg);
|
||||
|
||||
struct coroipcs_init_state {
|
||||
const char *socket_name;
|
||||
int sched_priority;
|
||||
int sched_policy;
|
||||
const struct sched_param *sched_param;
|
||||
void *(*malloc) (size_t size);
|
||||
void (*free) (void *ptr);
|
||||
void (*log_printf) (
|
||||
@ -61,7 +60,7 @@ struct coroipcs_init_state {
|
||||
int (*response_size_get)(unsigned int service, unsigned int id);
|
||||
int (*response_id_get)(unsigned int service, unsigned int id);
|
||||
int (*sending_allowed)(unsigned int service, unsigned int id,
|
||||
void *msg, void *sending_allowed_private_data);
|
||||
const void *msg, void *sending_allowed_private_data);
|
||||
void (*sending_allowed_release)(void *sending_allowed_private_data);
|
||||
void (*poll_accept_add)(int fd);
|
||||
void (*poll_dispatch_add)(int fd, void *context);
|
||||
@ -77,15 +76,25 @@ extern void coroipcs_ipc_init (
|
||||
|
||||
extern void *coroipcs_private_data_get (void *conn);
|
||||
|
||||
extern int coroipcs_response_send (void *conn, const void *msg, size_t mlen);
|
||||
extern int coroipcs_response_send (
|
||||
void *conn,
|
||||
const void *msg,
|
||||
size_t mlen);
|
||||
|
||||
extern int coroipcs_response_iov_send (void *conn,
|
||||
const struct iovec *iov, unsigned int iov_len);
|
||||
extern int coroipcs_response_iov_send (
|
||||
void *conn,
|
||||
const struct iovec *iov,
|
||||
unsigned int iov_len);
|
||||
|
||||
extern int coroipcs_dispatch_send (void *conn, const void *msg, size_t mlen);
|
||||
extern int coroipcs_dispatch_send (
|
||||
void *conn,
|
||||
const void *msg,
|
||||
size_t mlen);
|
||||
|
||||
extern int coroipcs_dispatch_iov_send (void *conn,
|
||||
const struct iovec *iov, unsigned int iov_len);
|
||||
extern int coroipcs_dispatch_iov_send (
|
||||
void *conn,
|
||||
const struct iovec *iov,
|
||||
unsigned int iov_len);
|
||||
|
||||
extern void coroipcs_refcount_inc (void *conn);
|
||||
|
||||
@ -93,8 +102,14 @@ extern void coroipcs_refcount_dec (void *conn);
|
||||
|
||||
extern void coroipcs_ipc_exit (void);
|
||||
|
||||
extern int coroipcs_handler_accept (int fd, int revent, void *context);
|
||||
extern int coroipcs_handler_accept (
|
||||
int fd,
|
||||
int revent,
|
||||
void *context);
|
||||
|
||||
extern int coroipcs_handler_dispatch (int fd, int revent, void *context);
|
||||
extern int coroipcs_handler_dispatch (
|
||||
int fd,
|
||||
int revent,
|
||||
void *context);
|
||||
|
||||
#endif /* COROIPCS_H_DEFINED */
|
||||
|
Loading…
Reference in New Issue
Block a user