https://bugs.winehq.org/show_bug.cgi?id=45935
--- Comment #2 from Joshua joshudson@gmail.com --- The program is generating an ordered list of unique files from multiple processes by MoveFile with "1", "2", "3", etc*. until the MoveFile goes through. The race condition exists because the implementation of MoveFile is checking if the target exists, and calling rename() if it doesn't. If the other process just did a rename to the same file in between the two system calls, one of the files in the sequence will be lost. rename() clobbers the target name if it exists.
*In fact it is timestamp_sequencenumber but the burst rate is several hundred per second.