From 2e9b4dd7405b7e4467e60d10e2ab7fd38a8f155d Mon Sep 17 00:00:00 2001 From: Jaidev Sridhar Date: Tue, 22 Apr 2014 12:35:38 -0400 Subject: [PATCH] regressions: Add memcpy test with ck_swlock latch --- regressions/ck_swlock/validate/validate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regressions/ck_swlock/validate/validate.c b/regressions/ck_swlock/validate/validate.c index bc2f496..11366ce 100644 --- a/regressions/ck_swlock/validate/validate.c +++ b/regressions/ck_swlock/validate/validate.c @@ -48,7 +48,7 @@ static struct affinity a; static unsigned int locked; static int nthr; static ck_swlock_t lock = CK_SWLOCK_INITIALIZER; - +static ck_swlock_t copy; #ifdef CK_F_PR_RTM static void * thread_rtm_adaptive(void *arg) @@ -285,6 +285,7 @@ thread_latch(void *arg) /* Writer */ ck_swlock_write_latch(&lock); { + memcpy(©, &lock, sizeof(ck_swlock_t)); l = ck_pr_load_uint(&locked); if (l != 0) { ck_error("ERROR [WR:%d]: %u != 0\n", __LINE__, l); @@ -317,6 +318,7 @@ thread_latch(void *arg) if (l != 0) { ck_error("ERROR [WR:%d]: %u != 0\n", __LINE__, l); } + memcpy(&lock, ©, sizeof(ck_swlock_t)); } ck_swlock_write_unlatch(&lock); }