2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

zdtm: Update futex-rl test for thread leader

Don't forget to test thread leader as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov
2012-11-12 12:33:53 +04:00
committed by Pavel Emelyanov
parent 300d2f2626
commit 71a65a96f5

View File

@@ -62,6 +62,8 @@ out:
int main(int argc, char **argv)
{
struct robust_list_head *head_orig = NULL, *head_new = NULL;
size_t len_orig = 0, len_new = 0;
pthread_t thread;
struct args *args;
@@ -73,6 +75,12 @@ int main(int argc, char **argv)
exit(1);
}
test_msg("Obtaining old RL for thread-leader\n");
if (syscall(__NR_get_robust_list, __gettid(), &head_orig, &len_orig)) {
fail("__NR_get_robust_list failed");
exit(1);
}
task_waiter_init(&args->waiter);
args->result = 0;
@@ -95,6 +103,17 @@ int main(int argc, char **argv)
task_waiter_complete(&args->waiter, 2);
test_msg("Obtaining new RL for thread-leader\n");
if (syscall(__NR_get_robust_list, __gettid(), &head_new, &len_new)) {
fail("__NR_get_robust_list failed");
exit(1);
}
if (head_orig != head_new || len_orig != len_new) {
fail("comparision failed");
exit(1);
}
pthread_join(thread, NULL);
if (args->result)
fail();