On Fri, Jan 22, 2016 at 12:13 PM, Ivan Khoronzhuk <
[email protected]> wrote:

> It's not convenient to see reused a thread id for threads that are
> finished to fast.
>
> Signed-off-by: Ivan Khoronzhuk <[email protected]>
>

Reviewed-by: Bill Fischofer <[email protected]>


> ---
>  test/validation/shmem/shmem.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c
> index 5524b5c..08425e6 100644
> --- a/test/validation/shmem/shmem.c
> +++ b/test/validation/shmem/shmem.c
> @@ -13,6 +13,8 @@
>  #define TEST_SHARE_FOO (0xf0f0f0f0)
>  #define TEST_SHARE_BAR (0xf0f0f0f)
>
> +static odp_barrier_t test_barrier;
> +
>  static void *run_shm_thread(void *arg)
>  {
>         odp_shm_info_t  info;
> @@ -20,6 +22,7 @@ static void *run_shm_thread(void *arg)
>         test_shared_data_t *test_shared_data;
>         int thr;
>
> +       odp_barrier_wait(&test_barrier);
>         thr = odp_thread_id();
>         printf("Thread %i starts\n", thr);
>
> @@ -72,6 +75,7 @@ void shmem_test_odp_shm_sunnyday(void)
>         if (thrdarg.numthrds > MAX_WORKERS)
>                 thrdarg.numthrds = MAX_WORKERS;
>
> +       odp_barrier_init(&test_barrier, thrdarg.numthrds);
>         odp_cunit_thread_create(run_shm_thread, &thrdarg);
>         odp_cunit_thread_exit(&thrdarg);
>  }
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to