History

GSF.Core: Added ShutdownHandler so ScheduledTask objects can be signaled and disposed of when the application shuts down. Also modified the WeakAction class to be more intuitive.

chishose committed 10 years ago

Commit 74b3a471 parent c6557e811 files · +728 −278Browse files

Showing the changes to Source/Libraries/GSF.Core.Shared/Threading/ThreadContainerThreadpool.cs (1 of 11 files). Show all

Unified · Split

Source/Libraries/GSF.Core.Shared/Threading/ThreadContainerThreadpool.cs+9−3
@@ -16,12 +16,13 @@ · 15 unmodified lines
16//16//
17// Code Modification History:17// Code Modification History:
18// ----------------------------------------------------------------------------------------------------18// ----------------------------------------------------------------------------------------------------
19// 3/8/2014 - Steven E. Chisholm19// 03/08/2014 - Steven E. Chisholm
20// Generated original version of source code. 20// Generated original version of source code.
21// 21//
22//22//
23//******************************************************************************************************23//******************************************************************************************************
24 24
25using System;
25using System.Diagnostics.CodeAnalysis;26using System.Diagnostics.CodeAnalysis;
26using System.Threading;27using System.Threading;
27 28
@@ -41,9 +42,14 @@ namespace GSF.Threading · 13 unmodified lines
41 /// </summary>42 /// </summary>
42 private ManualResetEvent m_waitObject;43 private ManualResetEvent m_waitObject;
43 44
44 public ThreadContainerThreadpool(WeakAction<CallbackArgs> callback)45 public ThreadContainerThreadpool(Action<CallbackArgs> callback, Action disposeAndWaitCallback, bool disposeOnShutdown)
45 : base(callback)46 : base(callback, disposeAndWaitCallback, disposeOnShutdown)
46 {47 {
48 if (disposeOnShutdown)
49 {
50 ShutdownHandler.TryRegisterCallback(Shutdown);
51 }
52
47 m_waitObject = new ManualResetEvent(false);53 m_waitObject = new ManualResetEvent(false);
48 }54 }
49 55

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t