Add API to query Session event pool size

This commit is contained in:
Robin Gareus 2022-06-09 00:41:23 +02:00
parent e81dd6a943
commit 03e0fe0a73
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 10 additions and 0 deletions

View File

@ -148,6 +148,7 @@ public:
static bool has_per_thread_pool ();
static void create_per_thread_pool (const std::string& n, uint32_t nitems);
static void init_event_pool ();
static guint pool_available ();
CrossThreadPool* event_pool() const { return own_pool; }

View File

@ -43,6 +43,15 @@ SessionEvent::init_event_pool ()
pool = new PerThreadPool;
}
guint
SessionEvent::pool_available ()
{
if (!pool || !pool->per_thread_pool (false)) {
return 0;
}
return pool->per_thread_pool()->available ();
}
bool
SessionEvent::has_per_thread_pool ()
{