From 60432933f300c8b03a1257a9f9a61ceecea0ce86 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 30 Sep 2016 00:16:43 +0300 Subject: [PATCH] Code refactoring of tests/subthread_create regarding AO add primitive * tests/subthread_create.c (entry): Use AO_fetch_and_add1(&v) instead of AO_fetch_and_add(&v,1). --- tests/subthread_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/subthread_create.c b/tests/subthread_create.c index 9a7095b..be57896 100644 --- a/tests/subthread_create.c +++ b/tests/subthread_create.c @@ -48,7 +48,7 @@ volatile AO_t thread_ended_cnt = 0; DWORD WINAPI entry(LPVOID arg) #endif { - int thread_num = AO_fetch_and_add(&thread_created_cnt, 1); + int thread_num = AO_fetch_and_add1(&thread_created_cnt); GC_word my_depth = (GC_word)arg + 1; if (my_depth <= MAX_SUBTHREAD_DEPTH @@ -78,7 +78,7 @@ volatile AO_t thread_ended_cnt = 0; # endif } - AO_fetch_and_add(&thread_ended_cnt, 1); + (void)AO_fetch_and_add1(&thread_ended_cnt); return 0; } -- 2.7.4