clumsy
clumsy copied to clipboard
this APP uses random seed incorrectly in some cases
trafficstars
According to the MSDN documentation on srand() (assuming you are using Microsoft's C runtime library), the seed is thread-local, so you need to call srand() for each thread that is using rand(). But in this APP, you call srand() in the main thread, but rand() is actually called in other thread(like divertReadLoop and divertClockLoop)