From: Piotr Caban Subject: Re: [PATCH 6/6] msvcp140_atomic_wait: Implement __std_bulk_submit_threadpool_work. Message-Id: <27c54241-0aa7-6094-6f00-def4230762a5@gmail.com> Date: Thu, 27 Jan 2022 15:34:02 +0100 In-Reply-To: References: Hi Daniel, On 1/26/22 23:50, Daniel Lehman wrote: > + /* canceling bulk submit */ > + workcalled = 0; > + work = p___std_create_threadpool_work(threadpool_workcallback, &workcalled, NULL); > + ok(!!work, "failed to create threadpool_work\n"); > + p___std_bulk_submit_threadpool_work(work, 1234); > + p___std_wait_for_threadpool_work_callbacks(work, TRUE); > + p___std_close_threadpool_work(work); > + ok(workcalled < 1234, "expected some work to be canceled, got %d\n", workcalled); The workcalled < 1234 occasionally fails on my machine (and if it doesn't we end with workcalled around 1230). Please remove the test or find a way to avoid the race. Please also use InterlockedIncrement when updating workcalled from multiple threads. Thanks, Piotr