1<Type Name="UnixSignal" FullName="Mono.Unix.UnixSignal"> 2 <TypeSignature Language="C#" Value="public class UnixSignal : System.Threading.WaitHandle" /> 3 <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit UnixSignal extends System.Threading.WaitHandle" /> 4 <AssemblyInfo> 5 <AssemblyName>Mono.Posix</AssemblyName> 6 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 7 <AssemblyVersion>2.0.0.0</AssemblyVersion> 8 <AssemblyVersion>4.0.0.0</AssemblyVersion> 9 </AssemblyInfo> 10 <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement> 11 <Base> 12 <BaseTypeName>System.Threading.WaitHandle</BaseTypeName> 13 </Base> 14 <Interfaces /> 15 <Docs> 16 <summary> 17 Represents the number of times a Unix signal has been emitted. 18 </summary> 19 <remarks> 20 <para> 21 Unix signals are used (generally) for two things: 22 </para> 23 <list type="bullet"> 24 <item> 25 <term> 26 Asynchronous alerts about events that occur within a process, such as 27 illegal instruction (<see cref="F:Mono.Unix.Native.Signum.SIGILL" />), 28 floating point exception (<see cref="F:Mono.Unix.Native.Signum.SIGFPE" />), 29 bus error (<see cref="F:Mono.Unix.Native.Signum.SIGBUS" />), 30 invalid memory access (<see cref="F:Mono.Unix.Native.Signum.SIGSEGV" />), 31 I/O is possible (<see cref="F:Mono.Unix.Native.Signum.SIGIO" />), 32 etc. 33 </term> 34 </item> 35 <item> 36 <term> 37 Asynchronous alerts of external "events", such as 38 termanal hangup (<see cref="F:Mono.Unix.Native.Signum.SIGHUP" />), 39 keyboard interrupt (<see cref="F:Mono.Unix.Native.Signum.SIGINT" />), 40 broken pipe (<see cref="F:Mono.Unix.Native.Signum.SIGPIPE" />), 41 program-defined actions 42 (<see cref="F:Mono.Unix.Native.Signum.SIGUSR1" />, 43 <see cref="F:Mono.Unix.Native.Signum.SIGUSR2" />), 44 child exit (<see cref="F:Mono.Unix.Native.Signum.SIGCHLD" />), 45 etc. 46 </term> 47 </item> 48 </list> 49 <para> 50 The key nature about signals is that they are asynchronous. In a 51 single threaded program, when a signal occurs the executing thread is 52 "hijacked" (no matter what it was previously doing) in order to 53 execute a (optionally registered) signal handler, and then the thread 54 resumes what it was previously doing (if possible; the signal handler 55 may abort the process as part of its execution). 56 </para> 57 <para> 58 In a multi-threaded program, a thread is selected at random among the 59 threads that can handle the signal, and that thread is hijacked to run 60 the signal handler before continuing (while the other threads continue 61 to execute in ignorance that a signal is occuring). 62 </para> 63 <para> 64 Tradtionally, <see cref="M:Mono.Unix.Native.Stdlib.signal" /> is used 65 to register a signal handler for a signal, and the registered handler 66 is invoked when the signal is generated. However, due to the 67 "hijacking" nature of the signal handling process, what the signal 68 handler could do is <i>severely</i> restricted: it must not invoke 69 non-reentrant library functions, and can only modify global data and 70 execute a limited set of system calls such as 71 <see cref="M:Mono.Unix.Native.Syscall.read" /> and 72 <see cref="M:Mono.Unix.Native.Syscall.write" />. 73 </para> 74 <para> 75 Managed code throws an additional wrench in the works, as the platform 76 invocation mechanism is neither reentrant nor signal safe. Consequently, 77 managed code <i>can not</i> be safely and reliably used as a signal 78 handler (as would traditionally be done with <c>signal</c>(2)), thus 79 the <see cref="T:Mono.Unix.UnixSignal" /> type. 80 </para> 81 <para> 82 A <see cref="T:Mono.Unix.UnixSignal" /> instance represents the number 83 of times that a Unix signal has been emitted. That's all. 84 <c>UnixSignal</c> instances support: 85 </para> 86 <list type="bullet"> 87 <item> 88 <term> 89 Accessing the number of times the Unix signal has been emitted via 90 the <see cref="P:Mono.Unix.UnixSignal.Count" /> 91 and <see cref="P:Mono.Unix.UnixSignal.IsSet" /> properties. 92 </term> 93 </item> 94 <item> 95 <term> 96 Clearing the count with <see cref="M:Mono.Unix.UnixSignal.Reset" />. 97 </term> 98 </item> 99 <item> 100 <term> 101 Sleeping until a signal has been emitted via 102 <see cref="M:Mono.Unix.UnixSignal.WaitAny" /> and 103 <see cref="M:Mono.Unix.UnixSignal.WaitOne" />. 104 </term> 105 </item> 106 </list> 107 <para> 108 In order to operate, this class uses an internal unmanaged signal 109 handler to represent the count information. Consequently, the count 110 will only be updated as long as no other mechanism is used to change 111 the registered signal handler, such as 112 <see cref="M:Mono.Unix.Native.Stdlib.signal" /> or 113 <see cref="M:Mono.Unix.Native.Stdlib.SetSignalAction" />. If you use 114 <see cref="M:Mono.Unix.Native.Stdlib.signal" /> or 115 <see cref="M:Mono.Unix.Native.Stdlib.SetSignalAction" /> for the same 116 signal as a created <c>UnixSignal</c> instance, the UnixSignal 117 instance will stop operating as documented. Don't Do That (TM). 118 </para> 119 <para> 120 There is currently a limit of 64 concurrent <c>UnixSignal</c> 121 instances within a process. 122 </para> 123 </remarks> 124 </Docs> 125 <Members> 126 <Member MemberName=".ctor"> 127 <MemberSignature Language="C#" Value="public UnixSignal (Mono.Unix.Native.RealTimeSignum rtsig);" /> 128 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype Mono.Unix.Native.RealTimeSignum rtsig) cil managed" /> 129 <MemberType>Constructor</MemberType> 130 <AssemblyInfo> 131 <AssemblyVersion>2.0.0.0</AssemblyVersion> 132 <AssemblyVersion>4.0.0.0</AssemblyVersion> 133 </AssemblyInfo> 134 <Parameters> 135 <Parameter Name="rtsig" Type="Mono.Unix.Native.RealTimeSignum" /> 136 </Parameters> 137 <Docs> 138 <param name="rtsig"> 139 A <see cref="T:Mono.Unix.Native.RealTimeSignum" /> value specifying which 140 Unix realtime signal this instance should count. 141 </param> 142 <summary> 143 Creates and initializes a <see cref="T:Mono.Unix.UnixSignal" /> 144 class instance. 145 </summary> 146 <remarks> 147 <para> 148 This constructor initializes the 149 <see cref="P:Mono.Unix.UnixSignal.RealTimeSignum" /> property of the new 150 instance using <paramref name="signum" />. 151 </para> 152 <para> 153 Once this constructor completes execution, all signal emissions 154 between the completion of the constructor and the invocation of 155 <see cref="M:System.Threading.WaitHandle.Close" /> will be 156 counted, updating the <see cref="M:Mono.Unix.UnixSignal.Count" /> 157 property. 158 </para> 159 <para> 160 Realtime signal registration has the constraint that it cannot override signals 161 registered from outside of Mono.Posix. 162 This constraint exists because the underlying aplication and runtime can use some 163 signals to implement some specific feature. 164 </para> 165 </remarks> 166 <exception cref="T:System.ArgumentException"> 167 The internal signal handler could not be registered or the signal was registered outside of Mono.Posix. 168 </exception> 169 <exception cref="T:System.ArgumentOutOfRangeException"> 170 <paramref name="signum" /> is not a valid signal value. 171 </exception> 172 </Docs> 173 </Member> 174 <Member MemberName=".ctor"> 175 <MemberSignature Language="C#" Value="public UnixSignal (Mono.Unix.Native.Signum signum);" /> 176 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype Mono.Unix.Native.Signum signum) cil managed" /> 177 <MemberType>Constructor</MemberType> 178 <AssemblyInfo> 179 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 180 <AssemblyVersion>2.0.0.0</AssemblyVersion> 181 <AssemblyVersion>4.0.0.0</AssemblyVersion> 182 </AssemblyInfo> 183 <Parameters> 184 <Parameter Name="signum" Type="Mono.Unix.Native.Signum" /> 185 </Parameters> 186 <Docs> 187 <param name="signum"> 188 A <see cref="T:Mono.Unix.Native.Signum" /> value specifying which 189 Unix signal this instance should count. 190 </param> 191 <summary> 192 Creates and initializes a <see cref="T:Mono.Unix.UnixSignal" /> 193 class instance. 194 </summary> 195 <remarks> 196 <para> 197 This constructor initializes the 198 <see cref="P:Mono.Unix.UnixSignal.Signum" /> property of the new 199 instance using <paramref name="signum" />. 200 </para> 201 <para> 202 Once this constructor completes execution, all signal emissions 203 between the completion of the constructor and the invocation of 204 <see cref="M:System.Threading.WaitHandle.Close" /> will be 205 counted, updating the <see cref="M:Mono.Unix.UnixSignal.Count" /> 206 property. 207 </para> 208 </remarks> 209 <exception cref="T:System.ArgumentException"> 210 The internal signal handler could not be registered. 211 </exception> 212 <exception cref="T:System.ArgumentOutOfRangeException"> 213 <paramref name="signum" /> is not a valid signal value. 214 </exception> 215 </Docs> 216 </Member> 217 <Member MemberName="Count"> 218 <MemberSignature Language="C#" Value="public int Count { get; set; }" /> 219 <MemberSignature Language="ILAsm" Value=".property instance int32 Count" /> 220 <MemberType>Property</MemberType> 221 <AssemblyInfo> 222 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 223 <AssemblyVersion>2.0.0.0</AssemblyVersion> 224 <AssemblyVersion>4.0.0.0</AssemblyVersion> 225 </AssemblyInfo> 226 <ReturnValue> 227 <ReturnType>System.Int32</ReturnType> 228 </ReturnValue> 229 <Docs> 230 <summary> 231 The number of times the <see cref="P:Mono.Unix.UnixSignal.Signum" /> 232 signal has been emitted since construction or the last call to 233 <see cref="M:Mono.Unix.UnixSignal.Reset" />. 234 </summary> 235 <value> 236 A <see cref="T:System.Int32" /> containing the number of the 237 of times the <see cref="P:Mono.Unix.UnixSignal.Signum" /> 238 signal has been emitted. 239 </value> 240 <remarks> 241 To clear the count, either assign 0 to the 242 <see cref="P:Mono.Unix.UnixSignal.Count" /> property or use 243 <see cref="M:Mono.Unix.UnixSignal.Reset" />. 244 </remarks> 245 <exception cref="T:System.ObjectDisposedException"> 246 The current instance has already been disposed. 247 </exception> 248 </Docs> 249 </Member> 250 <Member MemberName="Dispose"> 251 <MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" /> 252 <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" /> 253 <MemberType>Method</MemberType> 254 <AssemblyInfo> 255 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 256 <AssemblyVersion>2.0.0.0</AssemblyVersion> 257 <AssemblyVersion>4.0.0.0</AssemblyVersion> 258 </AssemblyInfo> 259 <ReturnValue> 260 <ReturnType>System.Void</ReturnType> 261 </ReturnValue> 262 <Parameters> 263 <Parameter Name="disposing" Type="System.Boolean" /> 264 </Parameters> 265 <Docs> 266 <param name="disposing"> 267 A <see cref="T:System.Boolean" />; if <see langword="true" />, then 268 this invocation is due to a 269 <see cref="M:System.Threading.WaitHandle.Close" /> call; 270 if <see langword="false" />, this invocation is from within the 271 finalizer. 272 </param> 273 <summary> 274 Cleanup all unmanaged resources. 275 </summary> 276 <remarks> 277 <block subset="none" type="behaviors"> 278 This method releases all unmanaged resources held by the current 279 instance. When <paramref name="disposing" /> is 280 <see langword="true" />, this method releases all resources held 281 by any managed objects referenced by the current instance. This 282 method invokes the <c>Dispose()</c> method of each referenced 283 object. 284 </block> 285 <block subset="none" type="overrides"> 286 Override this mthod to dispose of resources allocated by types 287 derived from <see cref="T:Mono.Unix.UnixSignal" />. When 288 overriding 289 <see cref="M:Mono.Unix.UnixSignal.Dispose(System.Boolean)" />, 290 be careful not to reference objects that have been previously 291 disposed an earlier call to <c>Dispose</c> or <c>Close</c>. 292 <c>Dispose</c> can be called multiple times by other objects. 293 </block> 294 <block subset="none" type="usage"> 295 This method is called by the protected 296 <see cref="M:System.Threading.WaitHandle.Dispose(System.Boolean)" /> 297 method and the <see cref="M:System.Object.Finalize" /> method. 298 <c>Dispose()</c> invokes this method with the 299 <paramref name="disposing" /> parameter set to 300 <see langword="true" />. 301 <see cref="M:System.Object.Finalize" /> invokes 302 <c>Dispose</c> with <paramref name="disposing" /> set to 303 <see langword="false" />. 304 </block> 305 </remarks> 306 </Docs> 307 </Member> 308 <Member MemberName="IsRealTimeSignal"> 309 <MemberSignature Language="C#" Value="public bool IsRealTimeSignal { get; }" /> 310 <MemberSignature Language="ILAsm" Value=".property instance bool IsRealTimeSignal" /> 311 <MemberType>Property</MemberType> 312 <AssemblyInfo> 313 <AssemblyVersion>2.0.0.0</AssemblyVersion> 314 <AssemblyVersion>4.0.0.0</AssemblyVersion> 315 </AssemblyInfo> 316 <ReturnValue> 317 <ReturnType>System.Boolean</ReturnType> 318 </ReturnValue> 319 <Docs> 320 <summary> 321 Returns <see langword="true" /> if the registered signal is realtime. 322 </summary> 323 <value> 324 A <see cref="T:System.Boolean" /> specifying whether or not the registered 325 signal is realtime. 326 </value> 327 <remarks> 328 </remarks> 329 </Docs> 330 </Member> 331 <Member MemberName="IsSet"> 332 <MemberSignature Language="C#" Value="public bool IsSet { get; }" /> 333 <MemberSignature Language="ILAsm" Value=".property instance bool IsSet" /> 334 <MemberType>Property</MemberType> 335 <AssemblyInfo> 336 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 337 <AssemblyVersion>2.0.0.0</AssemblyVersion> 338 <AssemblyVersion>4.0.0.0</AssemblyVersion> 339 </AssemblyInfo> 340 <ReturnValue> 341 <ReturnType>System.Boolean</ReturnType> 342 </ReturnValue> 343 <Docs> 344 <summary> 345 Returns <see langword="true" /> if 346 <see cref="P:Mono.Unix.UnixSignal.Count" /> is greater than 0. 347 </summary> 348 <value> 349 A <see cref="T:System.Boolean" /> specifying whether or not 350 <see cref="P:Mono.Unix.UnixSignal.Count" /> is greater than 0. 351 </value> 352 <remarks> 353 </remarks> 354 <exception cref="T:System.ObjectDisposedException"> 355 The current instance has already been disposed. 356 </exception> 357 </Docs> 358 </Member> 359 <Member MemberName="RealTimeSignum"> 360 <MemberSignature Language="C#" Value="public Mono.Unix.Native.RealTimeSignum RealTimeSignum { get; }" /> 361 <MemberSignature Language="ILAsm" Value=".property instance valuetype Mono.Unix.Native.RealTimeSignum RealTimeSignum" /> 362 <MemberType>Property</MemberType> 363 <AssemblyInfo> 364 <AssemblyVersion>2.0.0.0</AssemblyVersion> 365 <AssemblyVersion>4.0.0.0</AssemblyVersion> 366 </AssemblyInfo> 367 <ReturnValue> 368 <ReturnType>Mono.Unix.Native.RealTimeSignum</ReturnType> 369 </ReturnValue> 370 <Docs> 371 <summary> 372 The RealTime Unix signal this instance is counting 373 </summary> 374 <value> 375 A <see cref="T:Mono.Unix.Native.RealTimeSignum" /> value specifying which 376 RealTime Unix signal this instance is counting. 377 </value> 378 <remarks> 379 <para> 380 This value is set in the 381 <see cref="C:Mono.Unix.UnixSignal(Mono.Unix.Native.RealTimeSignum)" /> 382 constructor. 383 </para> 384 </remarks> 385 <exception cref="T:System.InvalidOperationException"> 386 The current instance is registered for a non-realtime signal. 387 </exception> 388 <exception cref="T:System.ObjectDisposedException"> 389 The current instance has already been disposed. 390 </exception> 391 </Docs> 392 </Member> 393 <Member MemberName="Reset"> 394 <MemberSignature Language="C#" Value="public bool Reset ();" /> 395 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Reset() cil managed" /> 396 <MemberType>Method</MemberType> 397 <AssemblyInfo> 398 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 399 <AssemblyVersion>2.0.0.0</AssemblyVersion> 400 <AssemblyVersion>4.0.0.0</AssemblyVersion> 401 </AssemblyInfo> 402 <ReturnValue> 403 <ReturnType>System.Boolean</ReturnType> 404 </ReturnValue> 405 <Parameters /> 406 <Docs> 407 <summary> 408 Clears the <see cref="P:Mono.Unix.UnixSignal.Count" /> property; the 409 return value specifies whether or not 410 <see cref="P:Mono.Unix.UnixSignal.Count" /> was not equal to 0 411 before it was cleared. 412 </summary> 413 <returns> 414 A <see cref="T:System.Boolean" /> specifying whether or not the 415 <see cref="P:Mono.Unix.UnixSignal.Count" /> property was not equal 416 to 0 before it was cleared. If <see langword="true" /> is returned, 417 <see cref="P:Mono.Unix.UnixSignal.Count" /> was not 0; if 418 <see langword="false" /> is returned, 419 <see cref="P:Mono.Unix.UnixSignal.Count" /> was 0. 420 </returns> 421 <remarks> 422 <para> 423 This method atomically checks and clears the 424 <see cref="P:Mono.Unix.UnixSignal.Count" /> property, and should 425 be preferred over manually checking and clearing the 426 <see cref="P:Mono.Unix.UnixSignal.Count" /> property. 427 </para> 428 </remarks> 429 <exception cref="T:System.ObjectDisposedException"> 430 The current instance has already been disposed. 431 </exception> 432 </Docs> 433 </Member> 434 <Member MemberName="Signum"> 435 <MemberSignature Language="C#" Value="public Mono.Unix.Native.Signum Signum { get; }" /> 436 <MemberSignature Language="ILAsm" Value=".property instance valuetype Mono.Unix.Native.Signum Signum" /> 437 <MemberType>Property</MemberType> 438 <AssemblyInfo> 439 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 440 <AssemblyVersion>2.0.0.0</AssemblyVersion> 441 <AssemblyVersion>4.0.0.0</AssemblyVersion> 442 </AssemblyInfo> 443 <ReturnValue> 444 <ReturnType>Mono.Unix.Native.Signum</ReturnType> 445 </ReturnValue> 446 <Docs> 447 <summary>The Unix signal this instance is counting.</summary> 448 <value> 449 A <see cref="T:Mono.Unix.Native.Signum" /> value specifying which 450 Unix signal this instance is counting. 451 </value> 452 <remarks> 453 <para> 454 This value is set in the 455 <see cref="C:Mono.Unix.UnixSignal(Mono.Unix.Native.Signum)" /> 456 constructor. 457 </para> 458 </remarks> 459 <exception cref="T:System.InvalidOperationException"> 460 The current instance is registered for a realtime signal. 461 </exception> 462 <exception cref="T:System.ObjectDisposedException"> 463 The current instance has already been disposed. 464 </exception> 465 </Docs> 466 </Member> 467 <Member MemberName="WaitAny"> 468 <MemberSignature Language="C#" Value="public static int WaitAny (Mono.Unix.UnixSignal[] signals);" /> 469 <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 WaitAny(class Mono.Unix.UnixSignal[] signals) cil managed" /> 470 <MemberType>Method</MemberType> 471 <AssemblyInfo> 472 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 473 <AssemblyVersion>2.0.0.0</AssemblyVersion> 474 <AssemblyVersion>4.0.0.0</AssemblyVersion> 475 </AssemblyInfo> 476 <ReturnValue> 477 <ReturnType>System.Int32</ReturnType> 478 </ReturnValue> 479 <Parameters> 480 <Parameter Name="signals" Type="Mono.Unix.UnixSignal[]" /> 481 </Parameters> 482 <Docs> 483 <param name="signals"> 484 A <see cref="T:Mono.Unix.UnixSignal" /> array containing the 485 <see cref="T:Mono.Unix.UnixSignal" /> instances to wait on. 486 </param> 487 <summary> 488 Blocks the current thread until one of the 489 <see cref="T:Mono.Unix.UnixSignal" /> instances within 490 <paramref name="signals" /> has a non-zero 491 <see cref="P:Mono.Unix.UnixSignal.Count" />. 492 </summary> 493 <returns> 494 Returns a <see cref="T:System.Int32" /> set to the index of the 495 element in <paramref name="signals" /> that received a signal. 496 </returns> 497 <remarks> 498 <para> 499 This method is equivalent to calling 500 <c>UnixSignal.WaitAny(<paramref name="signals" />, -1)</c>. 501 </para> 502 </remarks> 503 <exception cref="T:System.ArgumentNullException"> 504 <paramref name="signals" /> is <see langword="null" />. 505 </exception> 506 <exception cref="T:System.InvalidOperationException"> 507 One of the <see cref="T:Mono.Unix.UnixSignal" /> instances within 508 <paramref name="signals" /> was disposed. 509 </exception> 510 <altmember cref="M:Mono.Unix.UnixSignal.WaitAny(Mono.Unix.UnixSignal[],System.Int32)" /> 511 </Docs> 512 </Member> 513 <Member MemberName="WaitAny"> 514 <MemberSignature Language="C#" Value="public static int WaitAny (Mono.Unix.UnixSignal[] signals, int millisecondsTimeout);" /> 515 <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 WaitAny(class Mono.Unix.UnixSignal[] signals, int32 millisecondsTimeout) cil managed" /> 516 <MemberType>Method</MemberType> 517 <AssemblyInfo> 518 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 519 <AssemblyVersion>2.0.0.0</AssemblyVersion> 520 <AssemblyVersion>4.0.0.0</AssemblyVersion> 521 </AssemblyInfo> 522 <ReturnValue> 523 <ReturnType>System.Int32</ReturnType> 524 </ReturnValue> 525 <Parameters> 526 <Parameter Name="signals" Type="Mono.Unix.UnixSignal[]" /> 527 <Parameter Name="millisecondsTimeout" Type="System.Int32" /> 528 </Parameters> 529 <Docs> 530 <param name="signals"> 531 A <see cref="T:Mono.Unix.UnixSignal" /> array containing the 532 <see cref="T:Mono.Unix.UnixSignal" /> instances to wait on. 533 </param> 534 <param name="millisecondsTimeout"> 535 A <see cref="T:System.Int32" /> specifying the number of 536 milliseconds to wait before the method should return. <c>-1</c> 537 represents an infinite timeout. 538 </param> 539 <summary> 540 Blocks the current thread until one of the 541 <see cref="T:Mono.Unix.UnixSignal" /> instances within 542 <paramref name="signals" /> has a non-zero 543 <see cref="P:Mono.Unix.UnixSignal.Count" /> or the timeout expires. 544 </summary> 545 <returns> 546 If the method doesn't timeout, returns a 547 <see cref="T:System.Int32" /> set to the index of the 548 element in <paramref name="signals" /> that received a signal. 549 If the method does timeout, then 550 <paramref name="millisecondsTimeout" /> is returned. 551 </returns> 552 <remarks> 553 </remarks> 554 <exception cref="T:System.ArgumentNullException"> 555 <paramref name="signals" /> is <see langword="null" />. 556 </exception> 557 <exception cref="T:System.ArgumentOutOfRangeException"> 558 <paramref name="millisecondsTimeout" /> is less than <c>-1</c>. 559 </exception> 560 <exception cref="T:System.InvalidOperationException"> 561 One of the <see cref="T:Mono.Unix.UnixSignal" /> instances within 562 <paramref name="signals" /> was disposed. 563 </exception> 564 </Docs> 565 </Member> 566 <Member MemberName="WaitAny"> 567 <MemberSignature Language="C#" Value="public static int WaitAny (Mono.Unix.UnixSignal[] signals, TimeSpan timeout);" /> 568 <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 WaitAny(class Mono.Unix.UnixSignal[] signals, valuetype System.TimeSpan timeout) cil managed" /> 569 <MemberType>Method</MemberType> 570 <AssemblyInfo> 571 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 572 <AssemblyVersion>2.0.0.0</AssemblyVersion> 573 <AssemblyVersion>4.0.0.0</AssemblyVersion> 574 </AssemblyInfo> 575 <ReturnValue> 576 <ReturnType>System.Int32</ReturnType> 577 </ReturnValue> 578 <Parameters> 579 <Parameter Name="signals" Type="Mono.Unix.UnixSignal[]" /> 580 <Parameter Name="timeout" Type="System.TimeSpan" /> 581 </Parameters> 582 <Docs> 583 <param name="signals"> 584 A <see cref="T:Mono.Unix.UnixSignal" /> array containing the 585 <see cref="T:Mono.Unix.UnixSignal" /> instances to wait on. 586 </param> 587 <param name="timeout"> 588 A <see cref="T:System.TimeSpan" /> specifying how long the method 589 should wait before returning. Use a <see cref="T:System.TimeSpan" /> 590 with a <see cref="P:System.TimeSpan.TotalMilliseconds" /> value of 591 <c>-1</c> for an infinite timeout. 592 </param> 593 <summary> 594 Blocks the current thread until one of the 595 <see cref="T:Mono.Unix.UnixSignal" /> instances within 596 <paramref name="signals" /> has a non-zero 597 <see cref="P:Mono.Unix.UnixSignal.Count" /> or the timeout expires. 598 </summary> 599 <returns> 600 If the method doesn't timeout, returns a 601 <see cref="T:System.Int32" /> set to the index of the 602 element in <paramref name="signals" /> that received a signal. 603 If the method does timeout, then <paramref name="timeout" />'s 604 <see cref="P:System.TimeSpan.TotalMilliseconds" /> value cast to a 605 <see cref="T:System.Int32" /> is returned. 606 </returns> 607 <remarks> 608 <para> 609 This is equivalent to 610 <c>UnixSignal.WaitAny(<paramref name="signals" />, 611 timeout.TotalMilliseconds)</c>. 612 </para> 613 </remarks> 614 <exception cref="T:System.ArgumentNullException"> 615 <paramref name="signals" /> is <see langword="null" />. 616 </exception> 617 <exception cref="T:System.ArgumentOutOfRangeException"> 618 <paramref name="timeout" />'s 619 <see cref="P:System.TimeSpan.TotalMilliseconds" /> property is less 620 than <c>-1</c> or greater than <see cref="F:System.Int32.MaxValue" />. 621 </exception> 622 <exception cref="T:System.InvalidOperationException"> 623 One of the <see cref="T:Mono.Unix.UnixSignal" /> instances within 624 <paramref name="signals" /> was disposed. 625 </exception> 626 </Docs> 627 </Member> 628 <Member MemberName="WaitOne"> 629 <MemberSignature Language="C#" Value="public override bool WaitOne ();" /> 630 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool WaitOne() cil managed" /> 631 <MemberType>Method</MemberType> 632 <AssemblyInfo> 633 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 634 <AssemblyVersion>2.0.0.0</AssemblyVersion> 635 <AssemblyVersion>4.0.0.0</AssemblyVersion> 636 </AssemblyInfo> 637 <ReturnValue> 638 <ReturnType>System.Boolean</ReturnType> 639 </ReturnValue> 640 <Parameters /> 641 <Docs> 642 <summary> 643 Blocks the current thread until the curent instance has a non-zero 644 <see cref="P:Mono.Unix.UnixSignal.Count" />. 645 </summary> 646 <returns> 647 Returns <see langword="true" /> when the current instance receives a 648 signal. 649 </returns> 650 <remarks> 651 <para> 652 The caller of this method blocks indefinitely until the 653 <see cref="P:Mono.Unix.UnixSignal.Signum" /> signal is received by 654 the current process and the 655 <see cref="P:Mono.Unix.UnixSignal.Count" /> property is non-zero. 656 </para> 657 <para> 658 This method is equivalent to calling <c>WaitOne(-1)</c>. 659 </para> 660 </remarks> 661 <exception cref="T:System.ObjectDisposedException"> 662 The current instance has already been disposed. 663 </exception> 664 <altmember cref="M:Mono.Unix.UnixSignal.WaitOne(System.Int32)" /> 665 </Docs> 666 </Member> 667 <Member MemberName="WaitOne"> 668 <MemberSignature Language="C#" Value="public override bool WaitOne (int millisecondsTimeout, bool exitContext);" /> 669 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool WaitOne(int32 millisecondsTimeout, bool exitContext) cil managed" /> 670 <MemberType>Method</MemberType> 671 <AssemblyInfo> 672 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 673 <AssemblyVersion>2.0.0.0</AssemblyVersion> 674 <AssemblyVersion>4.0.0.0</AssemblyVersion> 675 </AssemblyInfo> 676 <ReturnValue> 677 <ReturnType>System.Boolean</ReturnType> 678 </ReturnValue> 679 <Parameters> 680 <Parameter Name="millisecondsTimeout" Type="System.Int32" /> 681 <Parameter Name="exitContext" Type="System.Boolean" /> 682 </Parameters> 683 <Docs> 684 <param name="millisecondsTimeout"> 685 A <see cref="T:System.Int32" /> containing the maximum number of 686 milliseconds the current thread should block before returning. 687 </param> 688 <param name="exitContext"> 689 This parameter must be <see langword="false" />. 690 </param> 691 <summary> 692 Blocks the current thread until the curent instance has a non-zero 693 <see cref="P:Mono.Unix.UnixSignal.Count" /> or the timeout expires. 694 </summary> 695 <returns> 696 Returns <see langword="true" /> when the current instance receives a 697 signal, otherwise <see langword="false" /> is returned if the 698 timeout is exceeded. 699 </returns> 700 <remarks> 701 <para> 702 The caller of this method blocks for up to 703 <paramref name="millisecondsTimeout" /> for the 704 <see cref="P:Mono.Unix.UnixSignal.Signum" /> signal to be received 705 by the current process and the 706 <see cref="P:Mono.Unix.UnixSignal.Count" /> property to become 707 non-zero. 708 </para> 709 </remarks> 710 <exception cref="T:System.ArgumentOutOfRangeException"> 711 <paramref name="millisecondsTimeout" /> is less than <c>-1</c>. 712 </exception> 713 <exception cref="T:System.InvalidOperationException"> 714 <paramref name="exitContext" /> is <see langword="true" />. 715 </exception> 716 <exception cref="T:System.ObjectDisposedException"> 717 The current instance has already been disposed. 718 </exception> 719 </Docs> 720 </Member> 721 <Member MemberName="WaitOne"> 722 <MemberSignature Language="C#" Value="public override bool WaitOne (TimeSpan timeout, bool exitContext);" /> 723 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool WaitOne(valuetype System.TimeSpan timeout, bool exitContext) cil managed" /> 724 <MemberType>Method</MemberType> 725 <AssemblyInfo> 726 <AssemblyVersion>1.0.5000.0</AssemblyVersion> 727 <AssemblyVersion>2.0.0.0</AssemblyVersion> 728 <AssemblyVersion>4.0.0.0</AssemblyVersion> 729 </AssemblyInfo> 730 <ReturnValue> 731 <ReturnType>System.Boolean</ReturnType> 732 </ReturnValue> 733 <Parameters> 734 <Parameter Name="timeout" Type="System.TimeSpan" /> 735 <Parameter Name="exitContext" Type="System.Boolean" /> 736 </Parameters> 737 <Docs> 738 <param name="timeout"> 739 A <see cref="T:System.TimeSpan" /> specifying how long the method 740 should wait before returning. Use a <see cref="T:System.TimeSpan" /> 741 with a <see cref="P:System.TimeSpan.TotalMilliseconds" /> value of 742 <c>-1</c> for an infinite timeout. 743 </param> 744 <param name="exitContext"> 745 This parameter must be <see langword="false" />. 746 </param> 747 <summary> 748 Blocks the current thread until the curent instance has a non-zero 749 <see cref="P:Mono.Unix.UnixSignal.Count" /> or the timeout expires. 750 </summary> 751 <returns> 752 Returns <see langword="true" /> when the current instance receives a 753 signal, otherwise <see langword="false" /> is returned if the 754 timeout is exceeded. 755 </returns> 756 <remarks> 757 <para> 758 The caller of this method blocks for up to 759 <c>timeout.TotalMilliseconds</c> milliseconds for the 760 <see cref="P:Mono.Unix.UnixSignal.Signum" /> signal to be received 761 by the current process and the 762 <see cref="P:Mono.Unix.UnixSignal.Count" /> property to become 763 non-zero. 764 </para> 765 </remarks> 766 <exception cref="T:System.ArgumentOutOfRangeException"> 767 <paramref name="timeout" />'s 768 <see cref="P:System.TimeSpan.TotalMilliseconds" /> property is less 769 than <c>-1</c> or greater than <see cref="F:System.Int32.MaxValue" />. 770 </exception> 771 <exception cref="T:System.InvalidOperationException"> 772 <paramref name="exitContext" /> is <see langword="true" />. 773 </exception> 774 <exception cref="T:System.ObjectDisposedException"> 775 The current instance has already been disposed. 776 </exception> 777 </Docs> 778 </Member> 779 </Members> 780</Type> 781