mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 05:00:39 +02:00
Close thread handle after suspend/resume (per MSDN ms684335)
This commit is contained in:
parent
6c2e01830c
commit
0be639e68a
|
@ -31,6 +31,9 @@ namespace MediaBrowser.ServerApplication.Native
|
|||
static extern uint SuspendThread(IntPtr hThread);
|
||||
[DllImport("kernel32.dll")]
|
||||
static extern int ResumeThread(IntPtr hThread);
|
||||
[DllImport("kernel32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool CloseHandle(IntPtr hObject);
|
||||
|
||||
public static void Suspend(this Process process)
|
||||
{
|
||||
|
@ -42,6 +45,7 @@ namespace MediaBrowser.ServerApplication.Native
|
|||
break;
|
||||
}
|
||||
SuspendThread(pOpenThread);
|
||||
CloseHandle(pOpenThread);
|
||||
}
|
||||
}
|
||||
public static void Resume(this Process process)
|
||||
|
@ -54,6 +58,7 @@ namespace MediaBrowser.ServerApplication.Native
|
|||
break;
|
||||
}
|
||||
ResumeThread(pOpenThread);
|
||||
CloseHandle(pOpenThread);
|
||||
}
|
||||
}
|
||||
public static void Print(this Process process)
|
||||
|
|
Loading…
Reference in a new issue