diff --git a/legacy/ecore/src/lib/ecore/Ecore.h b/legacy/ecore/src/lib/ecore/Ecore.h index 017f27b773..f23ed15d7a 100644 --- a/legacy/ecore/src/lib/ecore/Ecore.h +++ b/legacy/ecore/src/lib/ecore/Ecore.h @@ -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); diff --git a/legacy/ecore/src/lib/ecore/ecore_thread.c b/legacy/ecore/src/lib/ecore/ecore_thread.c index 6b9d2f82c8..f1ea10b2da 100644 --- a/legacy/ecore/src/lib/ecore/ecore_thread.c +++ b/legacy/ecore/src/lib/ecore/ecore_thread.c @@ -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 +}