mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 17:43:23 +00:00
added lwip_socket_thread_init/cleanup to use LWIP_NETCONN_SEM_PER_THREAD/LWIP_NETCONN_FULLDUPLEX without including anything but sockets.h
This commit is contained in:
parent
11f350e63f
commit
4b815eece9
@ -276,7 +276,7 @@ static void lwip_socket_drop_registered_memberships(int s);
|
|||||||
static struct lwip_sock sockets[NUM_SOCKETS];
|
static struct lwip_sock sockets[NUM_SOCKETS];
|
||||||
/** The global list of tasks waiting for select */
|
/** The global list of tasks waiting for select */
|
||||||
static struct lwip_select_cb *select_cb_list;
|
static struct lwip_select_cb *select_cb_list;
|
||||||
/** This counter is increased from lwip_select when the list is chagned
|
/** This counter is increased from lwip_select when the list is changed
|
||||||
and checked in event_callback to see if it has changed. */
|
and checked in event_callback to see if it has changed. */
|
||||||
static volatile int select_cb_ctr;
|
static volatile int select_cb_ctr;
|
||||||
|
|
||||||
@ -346,6 +346,20 @@ sockaddr_to_ipaddr_port(const struct sockaddr* sockaddr, ip_addr_t* ipaddr, u16_
|
|||||||
}
|
}
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||||
|
|
||||||
|
/** LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */
|
||||||
|
void
|
||||||
|
lwip_socket_thread_init(void)
|
||||||
|
{
|
||||||
|
netconn_thread_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore */
|
||||||
|
void
|
||||||
|
lwip_socket_thread_cleanup(void)
|
||||||
|
{
|
||||||
|
netconn_thread_cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map a externally used socket index to the internal socket representation.
|
* Map a externally used socket index to the internal socket representation.
|
||||||
*
|
*
|
||||||
|
@ -421,6 +421,8 @@ struct timeval {
|
|||||||
#endif /* LWIP_TIMEVAL_PRIVATE */
|
#endif /* LWIP_TIMEVAL_PRIVATE */
|
||||||
|
|
||||||
#define lwip_socket_init() /* Compatibility define, no init needed. */
|
#define lwip_socket_init() /* Compatibility define, no init needed. */
|
||||||
|
void lwip_socket_thread_init(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */
|
||||||
|
void lwip_socket_thread_cleanup(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore */
|
||||||
|
|
||||||
int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||||
int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen);
|
int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user