Based on [a patch](https://www.winehq.org/mailman3/hyperkitty/list/wine-devel@winehq.or… by Jinoh Kang (@iamahuman) from February 2022.
I removed the need for the event object and implemented fast paths for Linux.
On Linux 4.16+ `membarrier(MEMBARRIER_CMD_GLOBAL_EXPEDITED, ...)` is used.
On x86 Linux <= 4.15 `madvise(..., MADV_DONTNEED)` is used, which sends IPIs to all cores causing them to do a memory barrier.
On non-x86 Linux 4.3+ `membarrier(MEMBARRIER_CMD_SHARED, ...)` is used.
On Linux <= 4.2 and on other platforms the fallback path using APCs is used.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/741
Huw Davies (@huw) commented about include/wine/test.h:
> va_end(valist);
> }
>
> +void winetest_start_flaky( int is_flaky )
> +{
> + struct tls_data *data = get_tls_data();
> + data->flaky_level = (data->flaky_level << 1) | (is_flaky != 0);
> + data->flaky_do_loop=1;
Could we have spaces on either side of the '=', just like the lines above? I realise this is copied from the 'todo' functions, but still.
Similarly, two instances below.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/772#note_7560