diff options
Diffstat (limited to 'mcs/class/System/System.IO/FileSystemWatcher.cs')
-rw-r--r-- | mcs/class/System/System.IO/FileSystemWatcher.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mcs/class/System/System.IO/FileSystemWatcher.cs b/mcs/class/System/System.IO/FileSystemWatcher.cs index e4018da1210..d3d421ccc21 100644 --- a/mcs/class/System/System.IO/FileSystemWatcher.cs +++ b/mcs/class/System/System.IO/FileSystemWatcher.cs @@ -57,6 +57,7 @@ namespace System.IO { bool disposed; string mangledFilter; static IFileWatcher watcher; + static object lockobj = new object (); #endregion // Fields @@ -104,7 +105,7 @@ namespace System.IO { void InitWatcher () { - lock (typeof (FileSystemWatcher)) { + lock (lockobj) { if (watcher != null) return; |