Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HandlerRoutine()

static Interop.BOOL System.Runtime.InteropServices.PosixSignalRegistration.HandlerRoutine ( int dwCtrlType)
inlinestaticprivate

Definition at line 92 of file PosixSignalRegistration.cs.

93 {
95 switch (dwCtrlType)
96 {
97 case 0:
98 posixSignal = PosixSignal.SIGINT;
99 break;
100 case 1:
101 posixSignal = PosixSignal.SIGQUIT;
102 break;
103 case 6:
104 posixSignal = PosixSignal.SIGTERM;
105 break;
106 case 2:
107 posixSignal = PosixSignal.SIGHUP;
108 break;
109 default:
110 return Interop.BOOL.FALSE;
111 }
112 List<Token> list = null;
114 {
115 foreach (Token s_registration in s_registrations)
116 {
117 if (s_registration.Signal == posixSignal)
118 {
119 (list ?? (list = new List<Token>())).Add(s_registration);
120 }
121 }
122 }
123 if (list == null)
124 {
125 return Interop.BOOL.FALSE;
126 }
127 PosixSignalContext posixSignalContext = new PosixSignalContext(posixSignal);
128 foreach (Token item in list)
129 {
130 item.Handler(posixSignalContext);
131 }
132 if (!posixSignalContext.Cancel)
133 {
134 return Interop.BOOL.FALSE;
135 }
136 return Interop.BOOL.TRUE;
137 }
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.item, System.list, and System.Runtime.InteropServices.PosixSignalRegistration.s_registrations.

Referenced by System.Runtime.InteropServices.PosixSignalRegistration.Register(), and System.Runtime.InteropServices.PosixSignalRegistration.Unregister().