From: Ivan Maidanski Date: Thu, 29 Sep 2016 21:16:43 +0000 (+0300) Subject: Code refactoring of tests/subthread_create regarding AO add primitive X-Git-Tag: v8.0.0~1129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6043293;p=gc 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). --- diff --git a/tests/subthread_create.c b/tests/subthread_create.c index 9a7095b6..be578965 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; }