Skip to content
Commit 8d7a55ed authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov
Browse files

zdtm: Add task_waiter_ helpers v3



Sometime we need sync points in testee program flow,
for this reason task_waiter_ introduced.

The call semantics is the following

        Parent                  Child
        ------                  -----
        task_waiter_init
                                task_waiter_wait4
        task_waiter_complete
                                task_waiter_wait4
        task_waiter_complete

                ...

Thus initially task_waiter_init should be called
to initialize all internals guts needed.

Then one become waitee and calls for task_waiter_wait4,
where lockid should be provided as an argument. Since
it should be unique values the best option might be
gettid().

The same applies to a waiter side -- it should call
for task_waiter_complete and provide a lockid.

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: default avatarAndrey Vagin <avagin@parallels.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent 43f62f42
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment