aboutsummaryrefslogtreecommitdiffstats
path: root/server/channel.h
blob: 549ff213e6168442dbc94bb840fa2676a149f06c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef KV_SERVER_CHANNEL_H
#define KV_SERVER_CHANNEL_H

#include <kv.h>

#include <netinet/ip.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <rstypes.h>

#include <pthread.h>

/// Required for the calling thread to set socket file descriptor
struct thread_loop_arg {
	int *sock_dest;
	pthread_mutex_t *sock_mx;
	pthread_cond_t *sock_ready_cond;
	u64 owner;
	int pipefd;
};

// main function that manages every channel
void *thread_loop(void *);
void *new_thread_loop(void *);

#endif // KV_SERVER_CHANNEL_H
/* vim: set ts=8 noet: */