Commit 7173e9bd authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Darek Stojaczyk
Browse files

thread: add spdk_thread_has_pollers()



This function add possibility to check if there are registered pollers
on particular thread.

Change-Id: I80af06a10c5c1b54fed5bb28a3aa769a52d8a206
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/446624


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 4680db9e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@ spdk_nvme_probe_poll_async() were added to enable this feature.
Added new strip_size_kb rpc param on create to replace the more ambiguous
strip_size. The strip_size rpc param is deprecated.

### thread

Added spdk_thread_has_pollers() function to verify if there are
any registered pollers to be run on the thread.

## v19.01:

### ocf bdev
+10 −0
Original line number Diff line number Diff line
@@ -267,6 +267,16 @@ uint64_t spdk_thread_next_poller_expiration(struct spdk_thread *thread);
 */
int spdk_thread_has_active_pollers(struct spdk_thread *thread);

/**
 * Returns whether there are any pollers registered to be run
 * on the thread.
 *
 * \param thread The thread to check.
 *
 * \return true if there is any active poller, false otherwise.
 */
bool spdk_thread_has_pollers(struct spdk_thread *thread);

/**
 * Get count of allocated threads.
 */
+11 −0
Original line number Diff line number Diff line
@@ -549,6 +549,17 @@ spdk_thread_has_active_pollers(struct spdk_thread *thread)
	return !TAILQ_EMPTY(&thread->active_pollers);
}

bool
spdk_thread_has_pollers(struct spdk_thread *thread)
{
	if (TAILQ_EMPTY(&thread->active_pollers) &&
	    TAILQ_EMPTY(&thread->timer_pollers)) {
		return false;
	}

	return true;
}

uint32_t
spdk_thread_get_count(void)
{