You've already forked linux-packaging-mono
Imported Upstream version 5.14.0.116
Former-commit-id: a1060d06ad743429ccc16477092659123892e701
This commit is contained in:
parent
87382fcb2d
commit
f4dfa680ce
@@ -105,16 +105,16 @@ namespace System.IO {
|
||||
var result = new C ();
|
||||
|
||||
result.Changed += (object o, FileSystemEventArgs args) =>
|
||||
{ ProxyDispatch (o, FileAction.Modified, args); };
|
||||
Task.Run (() => ProxyDispatch (o, FileAction.Modified, args));
|
||||
result.Created += (object o, FileSystemEventArgs args) =>
|
||||
{ ProxyDispatch (o, FileAction.Added, args); };
|
||||
Task.Run (() => ProxyDispatch (o, FileAction.Added, args));
|
||||
result.Deleted += (object o, FileSystemEventArgs args) =>
|
||||
{ ProxyDispatch (o, FileAction.Removed, args); };
|
||||
Task.Run (() => ProxyDispatch (o, FileAction.Removed, args));
|
||||
result.Renamed += (object o, RenamedEventArgs args) =>
|
||||
{ ProxyDispatch (o, FileAction.RenamedNewName, args); };
|
||||
Task.Run (() => ProxyDispatch (o, FileAction.RenamedNewName, args));
|
||||
|
||||
result.Error += (object o, ErrorEventArgs args) =>
|
||||
{ ProxyDispatchError (handle, args); };
|
||||
Task.Run (() => ProxyDispatchError (handle, args));
|
||||
|
||||
Operation (map_op: (in_map, out_map, event_map, _) => {
|
||||
in_map.Add (handle, result);
|
||||
|
@@ -37,6 +37,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace System.IO {
|
||||
[DefaultEvent("Changed")]
|
||||
@@ -114,7 +115,7 @@ namespace System.IO {
|
||||
void InitWatcher ()
|
||||
{
|
||||
lock (lockobj) {
|
||||
if (watcher != null)
|
||||
if (watcher_handle != null)
|
||||
return;
|
||||
|
||||
string managed = Environment.GetEnvironmentVariable ("MONO_MANAGED_WATCHER");
|
||||
@@ -510,17 +511,17 @@ namespace System.IO {
|
||||
case FileAction.Added:
|
||||
lastData.Name = filename;
|
||||
lastData.ChangeType = WatcherChangeTypes.Created;
|
||||
OnCreated (new FileSystemEventArgs (WatcherChangeTypes.Created, path, filename));
|
||||
Task.Run (() => OnCreated (new FileSystemEventArgs (WatcherChangeTypes.Created, path, filename)));
|
||||
break;
|
||||
case FileAction.Removed:
|
||||
lastData.Name = filename;
|
||||
lastData.ChangeType = WatcherChangeTypes.Deleted;
|
||||
OnDeleted (new FileSystemEventArgs (WatcherChangeTypes.Deleted, path, filename));
|
||||
Task.Run (() => OnDeleted (new FileSystemEventArgs (WatcherChangeTypes.Deleted, path, filename)));
|
||||
break;
|
||||
case FileAction.Modified:
|
||||
lastData.Name = filename;
|
||||
lastData.ChangeType = WatcherChangeTypes.Changed;
|
||||
OnChanged (new FileSystemEventArgs (WatcherChangeTypes.Changed, path, filename));
|
||||
Task.Run (() => OnChanged (new FileSystemEventArgs (WatcherChangeTypes.Changed, path, filename)));
|
||||
break;
|
||||
case FileAction.RenamedOldName:
|
||||
if (renamed != null) {
|
||||
@@ -536,7 +537,8 @@ namespace System.IO {
|
||||
if (renamed == null) {
|
||||
renamed = new RenamedEventArgs (WatcherChangeTypes.Renamed, path, "", filename);
|
||||
}
|
||||
OnRenamed (renamed);
|
||||
var renamed_ref = renamed;
|
||||
Task.Run (() => OnRenamed (renamed_ref));
|
||||
renamed = null;
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user