diff options
Diffstat (limited to 'deps/uv/include/uv.h')
-rw-r--r-- | deps/uv/include/uv.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 32d481b23..5700f9413 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -845,6 +845,14 @@ UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle); * datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(), * etc.). In other words, other datagram-type sockets like raw sockets or * netlink sockets can also be passed to this function. + * + * This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other + * UNIX platforms, it sets the SO_REUSEADDR flag. What that means is that + * multiple threads or processes can bind to the same address without error + * (provided they all set the flag) but only the last one to bind will receive + * any traffic, in effect "stealing" the port from the previous listener. + * This behavior is something of an anomaly and may be replaced by an explicit + * opt-in mechanism in future versions of libuv. */ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); @@ -858,6 +866,14 @@ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); * * Returns: * 0 on success, or an error code < 0 on failure. + * + * This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other + * UNIX platforms, it sets the SO_REUSEADDR flag. What that means is that + * multiple threads or processes can bind to the same address without error + * (provided they all set the flag) but only the last one to bind will receive + * any traffic, in effect "stealing" the port from the previous listener. + * This behavior is something of an anomaly and may be replaced by an explicit + * opt-in mechanism in future versions of libuv. */ UV_EXTERN int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr, unsigned flags); @@ -1996,6 +2012,18 @@ UV_EXTERN void uv_barrier_wait(uv_barrier_t* barrier); */ UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void)); +/* Thread-local storage. These functions largely follow the semantics of + * pthread_key_create(), pthread_key_delete(), pthread_getspecific() and + * pthread_setspecific(). + * + * Note that the total thread-local storage size may be limited. + * That is, it may not be possible to create many TLS keys. + */ +UV_EXTERN int uv_key_create(uv_key_t* key); +UV_EXTERN void uv_key_delete(uv_key_t* key); +UV_EXTERN void* uv_key_get(uv_key_t* key); +UV_EXTERN void uv_key_set(uv_key_t* key, void* value); + UV_EXTERN int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg); UV_EXTERN unsigned long uv_thread_self(void); |