To elaborate on @JaredPar's answer, you have a race condition on your hands. If the first call creates the folder completely, and only then the second call starts, everything will be OK.
however, if the second call reaches the OS while it is still processing the first, the OS might fail the second one dune to locking issues, and you will get an exception.
It is still thread safe in the sense that you won't get any unpredictable folders created, or no folder at all.
To elaborate - while I'm not 100% sure that Windows doesn't have an internal race condition when the same folder is created twice concurrently, I'm pretty certain you won't be able to trash the disk by doing that, or get a deadlock with both creations being stuck to death. One of them will succeed, the other will fail, but the folder will be created.
So your heuristics, just to be absolutely sure, should be this:
- Create Directory
- If it fails, wait a random amount of time (say, between 0.2 and 0.5 of a second) and try again.
If it fails constantly (say, 3 times in a row), you have another problem at your hands - no permissions to the folder, a full disk, etc..
Incidentally, why not create the folder once when the application starts running?