Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
52f326cf
Commit
52f326cf
authored
Oct 05, 2018
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bb-10.4-wlad' into 10.4
parents
444c380c
98473a83
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
730 additions
and
436 deletions
+730
-436
include/violite.h
include/violite.h
+0
-9
sql/CMakeLists.txt
sql/CMakeLists.txt
+1
-0
sql/handle_connections_win.cc
sql/handle_connections_win.cc
+555
-0
sql/handle_connections_win.h
sql/handle_connections_win.h
+20
-0
sql/init.h
sql/init.h
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+124
-417
sql/mysqld.h
sql/mysqld.h
+5
-1
sql/threadpool_win.cc
sql/threadpool_win.cc
+24
-7
vio/viopipe.c
vio/viopipe.c
+0
-1
No files found.
include/violite.h
View file @
52f326cf
...
...
@@ -68,13 +68,6 @@ Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
Vio
*
mysql_socket_vio_new
(
MYSQL_SOCKET
mysql_socket
,
enum
enum_vio_type
type
,
uint
flags
);
#ifdef __WIN__
Vio
*
vio_new_win32pipe
(
HANDLE
hPipe
);
Vio
*
vio_new_win32shared_memory
(
HANDLE
handle_file_map
,
HANDLE
handle_map
,
HANDLE
event_server_wrote
,
HANDLE
event_server_read
,
HANDLE
event_client_wrote
,
HANDLE
event_client_read
,
HANDLE
event_conn_closed
);
#else
#define HANDLE void *
#endif
/* __WIN__ */
...
...
@@ -268,8 +261,6 @@ struct st_vio
#ifdef _WIN32
HANDLE
hPipe
;
OVERLAPPED
overlapped
;
DWORD
read_timeout_ms
;
DWORD
write_timeout_ms
;
#endif
};
#endif
/* vio_violite_h_ */
sql/CMakeLists.txt
View file @
52f326cf
...
...
@@ -152,6 +152,7 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
ADD_DEFINITIONS
(
-DHAVE_POOL_OF_THREADS
)
IF
(
WIN32
)
SET
(
SQL_SOURCE
${
SQL_SOURCE
}
threadpool_win.cc
)
SET
(
SQL_SOURCE
${
SQL_SOURCE
}
handle_connections_win.cc
)
ENDIF
()
SET
(
SQL_SOURCE
${
SQL_SOURCE
}
threadpool_generic.cc
)
...
...
sql/handle_connections_win.cc
0 → 100644
View file @
52f326cf
This diff is collapsed.
Click to expand it.
sql/handle_connections_win.h
0 → 100644
View file @
52f326cf
/* Copyright (c) 2018 MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
Handles incoming socket and pipe connections, on Windows.
Creates new (THD) connections..
*/
extern
void
handle_connections_win
();
sql/init.h
View file @
52f326cf
...
...
@@ -17,6 +17,6 @@
#define INIT_INCLUDED
void
unireg_init
(
ulong
options
);
ATTRIBUTE_NORETURN
void
unireg_end
(
void
);
void
unireg_end
(
void
);
#endif
/* INIT_INCLUDED */
sql/mysqld.cc
View file @
52f326cf
This diff is collapsed.
Click to expand it.
sql/mysqld.h
View file @
52f326cf
...
...
@@ -24,6 +24,7 @@
#include "mysql_com.h"
/* SERVER_VERSION_LENGTH */
#include "my_atomic.h"
#include "mysql/psi/mysql_file.h"
/* MYSQL_FILE */
#include "mysql/psi/mysql_socket.h"
/* MYSQL_SOCKET */
#include "sql_list.h"
/* I_List */
#include "sql_cmd.h"
#include <my_rnd.h>
...
...
@@ -92,6 +93,8 @@ void refresh_status(THD *thd);
bool
is_secure_file_path
(
char
*
path
);
void
dec_connection_count
(
scheduler_functions
*
scheduler
);
extern
void
init_net_server_extension
(
THD
*
thd
);
extern
void
handle_accepted_socket
(
MYSQL_SOCKET
new_sock
,
MYSQL_SOCKET
sock
);
extern
void
create_new_thread
(
CONNECT
*
connect
);
extern
"C"
MYSQL_PLUGIN_IMPORT
CHARSET_INFO
*
system_charset_info
;
extern
MYSQL_PLUGIN_IMPORT
CHARSET_INFO
*
files_charset_info
;
...
...
@@ -152,6 +155,7 @@ extern ulong opt_replicate_events_marked_for_skip;
extern
char
*
default_tz_name
;
extern
Time_zone
*
default_tz
;
extern
char
*
my_bind_addr_str
;
extern
int
server_socket_ai_family
;
extern
char
*
default_storage_engine
,
*
default_tmp_storage_engine
;
extern
char
*
enforced_storage_engine
;
extern
char
*
gtid_pos_auto_engines
;
...
...
@@ -760,7 +764,7 @@ enum enum_query_type
/* query_id */
extern
query_id_t
global_query_id
;
ATTRIBUTE_NORETURN
void
unireg_end
(
void
);
void
unireg_end
(
void
);
/* increment query_id and return it. */
inline
__attribute__
((
warn_unused_result
))
query_id_t
next_query_id
()
...
...
sql/threadpool_win.cc
View file @
52f326cf
...
...
@@ -70,6 +70,11 @@ static DWORD fls;
static
bool
skip_completion_port_on_success
=
false
;
PTP_CALLBACK_ENVIRON
get_threadpool_win_callback_environ
()
{
return
pool
?
&
callback_environ
:
0
;
}
/*
Threadpool callbacks.
...
...
@@ -134,7 +139,15 @@ struct TP_connection *new_TP_connection(CONNECT *connect)
void
TP_pool_win
::
add
(
TP_connection
*
c
)
{
SubmitThreadpoolWork
(((
TP_connection_win
*
)
c
)
->
work
);
if
(
FlsGetValue
(
fls
))
{
/* Inside threadpool(), execute callback directly. */
tp_callback
(
c
);
}
else
{
SubmitThreadpoolWork
(((
TP_connection_win
*
)
c
)
->
work
);
}
}
...
...
@@ -288,14 +301,13 @@ TP_connection_win::~TP_connection_win()
void
TP_connection_win
::
wait_begin
(
int
type
)
{
/*
Signal to the threadpool whenever callback can run long. Currently, binlog
waits are a good candidate, its waits are really long
*/
if
(
type
==
THD_WAIT_BINLOG
)
{
if
(
!
long_callback
)
if
(
!
long_callback
&&
callback_instance
)
{
CallbackMayRunLong
(
callback_instance
);
long_callback
=
true
;
...
...
@@ -308,12 +320,11 @@ void TP_connection_win::wait_end()
/* Do we need to do anything ? */
}
/*
This function should be called first whenever a callback is invoked in the
/*
This function should be called first whenever a callback is invoked in the
threadpool, does my_thread_init() if not yet done
*/
extern
ulong
thread_created
;
static
void
pre_callback
(
PVOID
context
,
PTP_CALLBACK_INSTANCE
instance
)
void
tp_win_callback_prolog
()
{
if
(
FlsGetValue
(
fls
)
==
NULL
)
{
...
...
@@ -323,6 +334,12 @@ static void pre_callback(PVOID context, PTP_CALLBACK_INSTANCE instance)
InterlockedIncrement
((
volatile
long
*
)
&
tp_stats
.
num_worker_threads
);
my_thread_init
();
}
}
extern
ulong
thread_created
;
static
void
pre_callback
(
PVOID
context
,
PTP_CALLBACK_INSTANCE
instance
)
{
tp_win_callback_prolog
();
TP_connection_win
*
c
=
(
TP_connection_win
*
)
context
;
c
->
callback_instance
=
instance
;
c
->
long_callback
=
false
;
...
...
vio/viopipe.c
View file @
52f326cf
...
...
@@ -131,7 +131,6 @@ int vio_close_pipe(Vio *vio)
CancelIo
(
vio
->
hPipe
);
CloseHandle
(
vio
->
overlapped
.
hEvent
);
DisconnectNamedPipe
(
vio
->
hPipe
);
ret
=
CloseHandle
(
vio
->
hPipe
);
vio
->
type
=
VIO_CLOSED
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment