mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #1033 from jluce50/dev
Close thread handle after suspend/resume
This commit is contained in:
commit
7958d8b380
@ -31,6 +31,9 @@ namespace MediaBrowser.ServerApplication.Native
|
|||||||
static extern uint SuspendThread(IntPtr hThread);
|
static extern uint SuspendThread(IntPtr hThread);
|
||||||
[DllImport("kernel32.dll")]
|
[DllImport("kernel32.dll")]
|
||||||
static extern int ResumeThread(IntPtr hThread);
|
static extern int ResumeThread(IntPtr hThread);
|
||||||
|
[DllImport("kernel32.dll")]
|
||||||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
|
public static extern bool CloseHandle(IntPtr hThread);
|
||||||
|
|
||||||
public static void Suspend(this Process process)
|
public static void Suspend(this Process process)
|
||||||
{
|
{
|
||||||
@ -42,6 +45,7 @@ namespace MediaBrowser.ServerApplication.Native
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SuspendThread(pOpenThread);
|
SuspendThread(pOpenThread);
|
||||||
|
CloseHandle(pOpenThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void Resume(this Process process)
|
public static void Resume(this Process process)
|
||||||
@ -54,6 +58,7 @@ namespace MediaBrowser.ServerApplication.Native
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ResumeThread(pOpenThread);
|
ResumeThread(pOpenThread);
|
||||||
|
CloseHandle(pOpenThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void Print(this Process process)
|
public static void Print(this Process process)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user