summaryrefslogtreecommitdiff
path: root/vio/vio.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-02-28 13:16:17 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-02-28 13:16:17 +0100
commitec89275da79a07e8906a6635c97c8925f9610bef (patch)
treecaa489ac345c382cb2c2d1d7c4ca5ec4989090f1 /vio/vio.c
parentf0c682858f26efcebabb558068aa567eed44632e (diff)
parentb64a2fef59bf7269a51884e74197d78c5ff203ff (diff)
downloadmariadb-git-ec89275da79a07e8906a6635c97c8925f9610bef.tar.gz
merge threadpool
Diffstat (limited to 'vio/vio.c')
-rw-r--r--vio/vio.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/vio/vio.c b/vio/vio.c
index b8bc7bdae08..415e3e23768 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -49,6 +49,25 @@ static my_bool has_no_data(Vio *vio __attribute__((unused)))
return FALSE;
}
+#ifdef _WIN32
+my_bool vio_shared_memory_has_data(Vio *vio)
+{
+ return (vio->shared_memory_remain > 0);
+}
+
+int vio_shared_memory_shutdown(Vio *vio, int how)
+{
+ SetEvent(vio->event_conn_closed);
+ SetEvent(vio->event_server_wrote);
+ return 0;
+}
+
+int vio_pipe_shutdown(Vio *vio, int how)
+{
+ return cancel_io(vio->hPipe, vio->thread_id);
+}
+#endif
+
/*
* Helper to fill most of the Vio* with defaults.
*/
@@ -89,6 +108,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->poll_read =no_poll_read;
vio->is_connected =vio_is_connected_pipe;
vio->has_data =has_no_data;
+ vio->shutdown =vio_pipe_shutdown;
vio->timeout=vio_win32_timeout;
/* Set default timeout */
@@ -116,7 +136,8 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->poll_read =no_poll_read;
vio->is_connected =vio_is_connected_shared_memory;
- vio->has_data =has_no_data;
+ vio->has_data =vio_shared_memory_has_data;
+ vio->shutdown =vio_shared_memory_shutdown;
/* Currently, shared memory is on Windows only, hence the below is ok*/
vio->timeout= vio_win32_timeout;
@@ -145,6 +166,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->poll_read =vio_poll_read;
vio->is_connected =vio_is_connected;
vio->has_data =vio_ssl_has_data;
+ vio->shutdown =vio_socket_shutdown;
DBUG_VOID_RETURN;
}
#endif /* HAVE_OPENSSL */
@@ -163,6 +185,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->timeout =vio_timeout;
vio->poll_read =vio_poll_read;
vio->is_connected =vio_is_connected;
+ vio->shutdown =vio_socket_shutdown;
vio->has_data= (flags & VIO_BUFFERED_READ) ?
vio_buff_has_data : has_no_data;
DBUG_VOID_RETURN;