+ecore_thread_active_get, ecore_thread_pending_get, ecore_thread_pending_long_get to retrieve number of threads present with given status

SVN revision: 50375
This commit is contained in:
Mike Blumenkrantz 2010-07-20 09:40:18 +00:00
parent 8bd358c65e
commit 75d478dfac
2 changed files with 51 additions and 0 deletions

View File

@ -350,6 +350,10 @@ extern "C" {
EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread);
EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread);
EAPI Eina_Bool ecore_thread_notify(Ecore_Thread *thread, const void *msg_data);
EAPI int ecore_thread_active_get(void);
EAPI int ecore_thread_pending_get(void);
EAPI int ecore_thread_pending_long_get(void);
EAPI double ecore_time_get(void);
EAPI double ecore_loop_time_get(void);

View File

@ -651,3 +651,50 @@ ecore_thread_notify(Ecore_Thread *thread, const void *data)
#endif
}
/**
* @brief Get number of active thread jobs
* @return Number of active threads running jobs
* This returns the number of threads currently running jobs through the
* ecore_thread api.
*/
EAPI int
ecore_thread_active_get(void)
{
#ifdef EFL_HAVE_PTHREAD
return eina_list_count(_ecore_thread);
#else
return 0;
#endif
}
/**
* @brief Get number of pending (short) thread jobs
* @return Number of pending threads running "short" jobs
* This returns the number of threads currently running jobs through the
* ecore_thread_run api call.
*/
EAPI int
ecore_thread_pending_get(void)
{
#ifdef EFL_HAVE_PTHREAD
return eina_list_count(_ecore_thread_data);
#else
return 0;
#endif
}
/**
* @brief Get number of pending long thread jobs
* @return Number of pending threads running "long" jobs
* This returns the number of threads currently running jobs through the
* ecore_long_run api call.
*/
EAPI int
ecore_thread_pending_long_get(void)
{
#ifdef EFL_HAVE_PTHREAD
return eina_list_count(_ecore_long_thread_data);
#else
return 0;
#endif
}