FreeBSD Bugzilla – Attachment 154559 Details for
Bug 198727
lang/mono: FileSystemWatcher (kevent) deadlock problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch - ready to go into files directory of port
patch-mcs_class_System_System.IO_KeventWatcher.cs (text/x-csharp), 2.26 KB, created by
Ivan Radovanovic
on 2015-03-20 08:39:09 UTC
(
hide
)
Description:
patch - ready to go into files directory of port
Filename:
MIME Type:
Creator:
Ivan Radovanovic
Created:
2015-03-20 08:39:09 UTC
Size:
2.26 KB
patch
obsolete
>--- mcs/class/System/System.IO/KeventWatcher.cs.orig 2015-03-18 21:38:07.000000000 +0100 >+++ mcs/class/System/System.IO/KeventWatcher.cs 2015-03-18 22:14:39.000000000 +0100 >@@ -150,7 +150,7 @@ > [StructLayout(LayoutKind.Sequential)] > struct timespec { > public IntPtr tv_sec; >- public IntPtr tv_usec; >+ public IntPtr tv_nsec; > } > > class PathData >@@ -213,7 +213,8 @@ > return; > > requestStop = true; >- thread.Join (); >+ if (thread.Join(2000)) >+ thread.Abort(); > requestStop = false; > > CleanUp (); >@@ -285,7 +286,7 @@ > > Scan (fsw.FullPath, false, ref initialFds); > >- var immediate_timeout = new timespec { tv_sec = (IntPtr)0, tv_usec = (IntPtr)0 }; >+ var immediate_timeout = new timespec { tv_sec = (IntPtr)0, tv_nsec = (IntPtr)0 }; > var eventBuffer = new kevent[0]; // we don't want to take any events from the queue at this point > var changes = CreateChangeList (ref initialFds); > >@@ -326,7 +327,7 @@ > > void Monitor () > { >- var timeout = new timespec { tv_sec = (IntPtr)0, tv_usec = (IntPtr)500000000 }; >+ var timeout = new timespec { tv_sec = (IntPtr)0, tv_nsec = (IntPtr)500000000 }; /* 0.5 sec */ > var eventBuffer = new kevent[32]; > var newFds = new List<int> (); > List<PathData> removeQueue = new List<PathData> (); >@@ -337,6 +338,9 @@ > > int numEvents = kevent (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, ref timeout); > >+ if (requestStop) >+ break; >+ > if (numEvents == -1) { > var errMsg = String.Format ("kevent() error, error code = '{0}'", Marshal.GetLastWin32Error ()); > fsw.OnError (new ErrorEventArgs (new IOException (errMsg))); >@@ -539,14 +543,18 @@ > if (action == FileAction.RenamedNewName) > renamed = new RenamedEventArgs (WatcherChangeTypes.Renamed, "", newPath, path); > >- lock (fsw) { >- fsw.DispatchEvents (action, path, ref renamed); >- >- if (fsw.Waiting) { >- fsw.Waiting = false; >- System.Threading.Monitor.PulseAll (fsw); >+ var thr = new Thread(() => { >+ lock (fsw) { >+ fsw.DispatchEvents (action, path, ref renamed); >+ >+ if (fsw.Waiting) { >+ fsw.Waiting = false; >+ System.Threading.Monitor.PulseAll (fsw); >+ } > } >- } >+ }); >+ thr.IsBackground = true; >+ thr.Start(); > } > > private string GetFilenameFromFd (int fd)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 198727
:
154559
|
166119
|
166140
|
201376