0

Would it be a bad practice to call Directory.CreateDirectory() from within a lock()? Would it lead to any threading issues?

svrcoder
  • 96
  • 1
  • 9

1 Answers1

2

One does not need a lock as that is additional overhead. However, appropriate exception handling is needed.

Please refer to this question for further details.

Is CreateDirectory() in C# thread-safe?

Jon Raynor
  • 3,804
  • 6
  • 29
  • 43