Main reason for this was there was a crash in shutdown of the server
in binlog_encryption.encryption_combo-mix and some other tests because
something in listen_sockets where not initialized. Changing to
Dynamic_array caused things to work.
Other reason for removing std::vector was that it is harder to debug,
and not integrated with DBUG, safemalloc, valgrind or memory
calculation and cause code explosions (extra code generated for each
std::vector type used).
The test timeouts, because mtr is waiting for pid file.
The pid file is not there, because expected to fail mysqld startup
(duplicate named pipe name), this startup removed pid file of the running
mysqld instance.
To fix, split handle_connections_win() into the initialization part,
and accept/handle part, like it is done elsewhere.
The initialization part runs before pid file handling, and aborts on errors
, thus avoiding pid file overwrites.
Removed the existing nt_service classes - they provide little
abstraction, and only obscure a relatively simple service handling.
This replaces by similar code inspired by MS docs samples.
Service handling is now moved into winmain.cc, which contains
the main() function for Windows.
winmain provides reporting callbacks, which should be used by external code
,to report transitions from starting to running to shutting down to stopped.
Removed a do-nothing ServiceMain thread, and the
non-working service "pause/continue". Removed a lot of #ifdef __WIN__
code from mysqld.cc
Do not try to compile threadpool_common.cc, if threadpool is not available
on current OS.
Also introduced undocumented/uncached CMake variable DISABLE_THREADPOOL,
to emulate builds on exotic OSes.
Remove threads that are doing nothing but wait
- main thread now handles the connections
(if threadpool is used, also threadpool threads would wait for connections)
- thread for socket and pipe connections are removed
- shutdown thread is now removed, we wait for shutdown
notification in main thread as well
- kill_server() is also called inside the main thread, after connection
loop finished.