Message ID | 1418901579-29209-1-git-send-email-taras.kondratiuk@linaro.org |
---|---|
State | Accepted |
Commit | 2da50e616965e4b17bafa34897e99fd2f5645dc5 |
Headers | show |
Merged, both. Maxim. On 12/18/2014 02:59 PM, Savolainen, Petri (NSN - FI/Espoo) wrote: > Both patches: > > Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> > >> -----Original Message----- >> From: ext Taras Kondratiuk [mailto:taras.kondratiuk@linaro.org] >> Sent: Thursday, December 18, 2014 1:20 PM >> To: lng-odp@lists.linaro.org; Savolainen, Petri (NSN - FI/Espoo) >> Cc: Taras Kondratiuk >> Subject: [PATCH 1/2] api: init: add a way to determine a last ODP thread >> termination >> >> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> >> --- >> platform/linux-generic/include/api/odp_init.h | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/platform/linux-generic/include/api/odp_init.h >> b/platform/linux-generic/include/api/odp_init.h >> index 49f5e41..22ed88d 100644 >> --- a/platform/linux-generic/include/api/odp_init.h >> +++ b/platform/linux-generic/include/api/odp_init.h >> @@ -82,6 +82,10 @@ int odp_init_global(odp_init_t *params, >> odp_platform_init_t *platform_params); >> * In general it calls the API modules terminate functions in the reverse >> order >> * to that which the module init functions were called during >> odp_init_global() >> * >> + * @note This function should be called by the last ODP thread. To >> simplify >> + * synchronization between threads odp_term_local() indicates by its >> return >> + * value if it was the last thread. >> + * >> * @warning The unwinding of HW resources to allow them to be re used >> without reseting >> * the device is a complex task that the application is expected to >> coordinate. >> * This api may have platform dependant implications. >> @@ -120,14 +124,14 @@ int odp_init_local(void); >> * odp_init_local() >> * >> * @sa odp_init_local() >> - * @sa odp_term_global() which is the final ODP call before exit of an >> application. >> + * @sa odp_term_global() should be called by the last ODP thread before >> exit >> + * of an application. >> * >> * @warning The unwinding of HW resources to allow them to be re used >> without reseting >> * the device is a complex task that the application is expected to >> coordinate. >> - * All threads must call this function before calling >> - * any other ODP API functions. >> * >> - * @retval 0 if successful >> + * @retval 1 if successful and more ODP thread exists >> + * @retval 0 if successful and it was the last ODP thread >> * @retval -1 on failure >> */ >> int odp_term_local(void); >> -- >> 1.9.1 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 49f5e41..22ed88d 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -82,6 +82,10 @@ int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params); * In general it calls the API modules terminate functions in the reverse order * to that which the module init functions were called during odp_init_global() * + * @note This function should be called by the last ODP thread. To simplify + * synchronization between threads odp_term_local() indicates by its return + * value if it was the last thread. + * * @warning The unwinding of HW resources to allow them to be re used without reseting * the device is a complex task that the application is expected to coordinate. * This api may have platform dependant implications. @@ -120,14 +124,14 @@ int odp_init_local(void); * odp_init_local() * * @sa odp_init_local() - * @sa odp_term_global() which is the final ODP call before exit of an application. + * @sa odp_term_global() should be called by the last ODP thread before exit + * of an application. * * @warning The unwinding of HW resources to allow them to be re used without reseting * the device is a complex task that the application is expected to coordinate. - * All threads must call this function before calling - * any other ODP API functions. * - * @retval 0 if successful + * @retval 1 if successful and more ODP thread exists + * @retval 0 if successful and it was the last ODP thread * @retval -1 on failure */ int odp_term_local(void);
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> --- platform/linux-generic/include/api/odp_init.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)