Click or drag to resize

Abortable Klasse

DotNet 7.0 threading helper class. Behaves like Thread, except the following specials: - Abort() works similarly to previous runtime versions; - Abortable offers an additional property 'AbortableException'; - Abortable implements IDisposable. Usage: replace "new Thread..." with "new Abortable...", Call Dispose on Abortable-instance when it's no longer used. Attention: This class uses Run(Action, CancellationToken), which was released with.Net 7.0. Although this method is new, it has been marked as "deprecated"!
Vererbungshierarchie
SystemObject
  NetEti.ApplicationControlAbortable

Namensraum: NetEti.ApplicationControl
Assembly: NetEti.ProcessTools (in NetEti.ProcessTools.dll) Version: 1.0.0+6e6ab0c4fed8e24cd32ff9136ecb6b264898a6a9
Syntax
public class Abortable

Der Abortable Typ exponiert die folgenden Member.

Konstruktoren
 NameBeschreibung
Public MethodeAbortable(ParameterizedThreadStart) Creates a new Abortable-instance for a parameterized thread.
Public MethodeAbortable(ThreadStart) Creates a new Abortable-instance for a parameterless thread.
Public MethodeAbortable(ParameterizedThreadStart, Int32) Creates a new Abortable-instance for a parameterized thread with a given maximum stacksize.
Public MethodeAbortable(ThreadStart, Int32) Creates a new Abortable-instance for a parameterless thread with a given maximum stacksize.
Zurück nach oben
Eigenschaften
 NameBeschreibung
Public EigenschaftAbortableException Contans an optional exception of the executed thread.
Public EigenschaftApartmentStateObsolet.
Is no longer supported.
Public EigenschaftCurrentCulture Contains the current culture.
Public EigenschaftStatic MemberCurrentPrincipal Contains the current principal or null.
Public EigenschaftStatic MemberCurrentThread Leads to the CurrentThread.
Public EigenschaftCurrentUICulture Contains the current ui-culture.
Public EigenschaftExecutionContext Leads to Thread.ExecutionContext.
Public EigenschaftIsAliveReturns true if the thread has been started and is not dead.
Public EigenschaftIsBackground Return whether or not this thread is a background thread. Background threads do not affect when the Execution Engine shuts down.
Public EigenschaftIsThreadPoolThreadReturns true if the thread is a threadpool thread.
Public EigenschaftManagedThreadId Leads to the extern int thread-id.
Public EigenschaftName Contains the thread-name or null.
Public EigenschaftPriorityReturns the priority of the thread.
Public EigenschaftThreadState Return the thread state as a consistent set of bits. This is more general then IsAlive or IsBackground.
Zurück nach oben
Methoden
 NameBeschreibung
Public MethodeAbort Throws a System.Threading.ThreadAbortException on the thread on which the call was done to start thread termination. By calling this method the thread is usually terminated. Exceptions: T:System.PlatformNotSupportedException: .NET Core only: This member is not supported. T:System.Security.SecurityException: The caller does not have the required permission. T:System.Threading.ThreadStateException: The thread that was killed is currently suspended.
Public MethodeAbort(Object)Obsolet.
Is no longer supported. Throws a System.Threading.ThreadAbortException on the thread on which the call was done to start thread termination. By calling this method the thread is usually terminated. Exceptions: T:System.PlatformNotSupportedException: .NET Core only: This member is not supported. T:System.Security.SecurityException: The caller does not have the required permission. T:System.Threading.ThreadStateException: The thread that was killed is currently suspended.
Public MethodeStatic MemberAllocateDataSlot Leads to Thread.AllocateDataSlot().
Public MethodeStatic MemberAllocateNamedDataSlot Leads to Thread.AllocateNamedDataSlot(...).
Public MethodeStatic MemberBeginCriticalRegion Leads to Thread.BeginCriticalRegion().
Public MethodeStatic MemberBeginThreadAffinity Leads to Thread.BeginThreadAffinity().
Public MethodeDisableComObjectEagerCleanup Leads to the extern void DisableComObjectEagerCleanup.
Public MethodeStatic MemberEndCriticalRegion Leads to Thread.EndCriticalRegion().
Public MethodeStatic MemberEndThreadAffinity Leads to Thread.EndThreadAffinity().
Public MethodeStatic MemberFreeNamedDataSlot Leads to Thread.FreeNamedDataSlot(...).
Public MethodeGetApartmentState Leads to the internal Interop ApartmentState.
Public MethodeGetCompressedStackObsolet.
Is no longer supported.
Public MethodeStatic MemberGetCurrentProcessorId Returns the current processor-id.
Public MethodeStatic MemberGetData Leads to Thread.GetNamedDataSlot(...).
Public MethodeStatic MemberGetDomain Leads to Thread.GetDomain().
Public MethodeStatic MemberGetDomainID Leads to Thread.GetDomainID().
Public MethodeGetHashCode Leads to Thread.GetHashCode().
(Überschreibt ObjectGetHashCode)
Public MethodeStatic MemberGetNamedDataSlot Leads to Thread.GetNamedDataSlot(...).
Public MethodeGetThread Returns the current helper-thread or null.
Public MethodeInterrupt Interrupts a thread that is inside a Wait(), Sleep() or Join(). If that thread is not currently blocked in that manner, it will be interrupted when it next begins to block.
Public MethodeJoin Leads to Thread.Join().
Public MethodeJoin(Int32) Waits for the thread to die or for timeout milliseconds to elapse.
Public MethodeJoin(TimeSpan) Leads to Thread.Join(...).
Public MethodeStatic MemberMemoryBarrier Leads to Thread.MemoryBarrier.
Public MethodeStatic MemberResetAbortObsolet.
Is no longer supported.
Public MethodeResumeObsolet.
Is no longer supported.
Public MethodeSetApartmentState Leads to Thread.SetApartmentState(...).
Public MethodeSetCompressedStackObsolet.
Is no longer supported.
Public MethodeStatic MemberSetData Leads to Thread.SetData(...).
Public MethodeStatic MemberSleep(Int32) Suspends the current thread for timeout milliseconds. If timeout == 0, forces the thread to give up the remainder of its timeslice. If timeout == Timeout.Infinite, no timeout will occur.
Public MethodeStatic MemberSleep(TimeSpan) Leads to Thread.Sleep(...).
Public MethodeStatic MemberSpinWait Wait for a length of time proportional to 'iterations'. Each iteration is should only take a few machine instructions. Calling this API is preferable to coding a explicit busy loop because the hardware can be informed that it is busy waiting.
Public MethodeStartCauses the operating system to change the state of the current instance to Running.
Public MethodeStart(Object)Causes the operating system to change the state of the current instance to Running, and optionally supplies an object containing data to be used by the method the thread executes.
Public MethodeSuspendObsolet.
Is no longer supported.
Public MethodeTrySetApartmentState Leads to Thread.TrySetApartmentState(...).
Public MethodeUnsafeStartCauses the operating system to change the state of the current instance to Running.
Public MethodeUnsafeStart(Object)Causes the operating system to change the state of the current instance to Running, and optionally supplies an object containing data to be used by the method the thread executes.
Public MethodeStatic MemberVolatileRead(Byte) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Double) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Int16) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Int32) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Int64) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(IntPtr) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Object) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(SByte) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(Single) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(UInt16) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(UInt32) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(UInt64) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileRead(UIntPtr) Leads to Thread.VolatileRead(...).
Public MethodeStatic MemberVolatileWrite(Byte, Byte) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Double, Double) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Int16, Int16) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Int32, Int32) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Int64, Int64) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(IntPtr, IntPtr) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Object, Object) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(SByte, SByte) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(Single, Single) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(UInt16, UInt16) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(UInt32, UInt32) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(UInt64, UInt64) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberVolatileWrite(UIntPtr, UIntPtr) Leads to Thread.VolatileWrite(...).
Public MethodeStatic MemberYield Leads to YieldInternal.
Zurück nach oben
Anmerkungen
17.03.2023 Erik Nagel: created. 06.08.2023 Erik Nagel: Added missing comments.
Siehe auch