Add a mechanism to synchronize persistent pool counts

The polling system now has a concept of messages. This can be used to send
a synchronous message to the polling system which waits for all threads to
process the message before returning.

Currently this is used to flush unused DCBs when server persistent
statistics are reported.
This commit is contained in:
Markus Makela
2016-11-26 08:19:36 +02:00
parent 8573df6ee7
commit 7cbbc6f8f7
4 changed files with 75 additions and 4 deletions

View File

@ -553,6 +553,7 @@ dprintServer(DCB *dcb, SERVER *server)
if (server->persistpoolmax)
{
dcb_printf(dcb, "\tPersistent pool size: %d\n", server->stats.n_persistent);
poll_send_message(POLL_MSG_CLEAN_PERSISTENT, server);
dcb_printf(dcb, "\tPersistent measured pool size: %d\n", server->stats.n_persistent);
dcb_printf(dcb, "\tPersistent actual size max: %d\n", server->persistmax);
dcb_printf(dcb, "\tPersistent pool size limit: %ld\n", server->persistpoolmax);