AbandonedMutexExceptionとは? わかりやすく解説

AbandonedMutexException クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

スレッドが、別のスレッド解放せずに終了することによって放棄した Mutex オブジェクト取得したときにスローされる例外

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(False)> _
Public Class AbandonedMutexException
    Inherits SystemException
Dim instance As AbandonedMutexException
[SerializableAttribute] 
[ComVisibleAttribute(false)] 
public class AbandonedMutexException : SystemException
[SerializableAttribute] 
[ComVisibleAttribute(false)] 
public ref class AbandonedMutexException :
 public SystemException
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(false) */ 
public class AbandonedMutexException extends
 SystemException
SerializableAttribute 
ComVisibleAttribute(false) 
public class AbandonedMutexException extends
 SystemException
解説解説
使用例使用例

5 つミューテックス放棄するスレッド実行し、それによって WaitOne、WaitAny、および WaitAll の各メソッドどのような影響を受けるかを示すコード例次に示します。MutexIndex プロパティの値は、WaitAny呼び出しに対して表示されています。

メモメモ

WaitAny メソッド呼び出しは、放棄されミューテックス1 つによって中断されます。また、放棄された他のミューテックスにより、後続待機メソッドAbandonedMutexExceptionスローされる可能性あります

Option Explicit
Imports System
Imports System.Threading

Public Class Example
    Private Shared _dummy As
 New ManualResetEvent(False)

    Private Shared _orphan1 As
 New Mutex()
    Private Shared _orphan2 As
 New Mutex()
    Private Shared _orphan3 As
 New Mutex()
    Private Shared _orphan4 As
 New Mutex()
    Private Shared _orphan5 As
 New Mutex()

    <MTAThread> _
    Public Shared Sub Main()
        ' Start a thread that takes all five mutexes, and then
        ' ends without releasing them.
        '
        Dim t As New Thread(AddressOf
 AbandonMutex)
        t.Start()
        ' Make sure the thread is finished.
        t.Join()

        ' Wait on one of the abandoned mutexes. The WaitOne returns
        ' immediately, because its wait condition is satisfied by
        ' the abandoned mutex, but on return it throws
        ' AbandonedMutexException.
        Try
            _orphan1.WaitOne()
            Console.WriteLine("WaitOne succeeded.")
        Catch ex As AbandonedMutexException
            Console.WriteLine("Exception on return from WaitOne."
 _
                & vbCrLf & vbTab & "Message: "
 _
                & ex.Message) 
        Finally
            ' Whether or not the exception was thrown, the current
            ' thread owns the mutex, and must release it.
            '
            _orphan1.ReleaseMutex()
        End Try

        ' Create an array of wait handles, consisting of one
        ' ManualResetEvent and two mutexes, using two more of the
        ' abandoned mutexes.
        Dim waitFor(2) As WaitHandle
        waitFor(0) = _dummy
        waitFor(1) = _orphan2
        waitFor(2) = _orphan3

        ' WaitAny returns when any of the wait handles in the 
        ' array is signaled, so either of the two abandoned mutexes
        ' satisfy its wait condition. On returning from the wait,
        ' WaitAny throws AbandonedMutexException. The MutexIndex
        ' property returns the lower of the two index values for 
        ' the abandoned mutexes. Note that the Try block and the
        ' Catch block obtain the index in different ways.
        '  
        Try
            Dim index As Integer
 = WaitHandle.WaitAny(waitFor)
            Console.WriteLine("WaitAny succeeded.")

            Dim m As Mutex = TryCast(waitFor(index),
 Mutex)

            ' The current thread owns the mutex, and must release
            ' it.
            If m IsNot Nothing Then
 m.ReleaseMutex()
        Catch ex As AbandonedMutexException
            Console.WriteLine("Exception on return from WaitAny
 at index " _
                & ex.MutexIndex & "." _
                & vbCrLf & vbTab & "Message: "
 _
                & ex.Message) 

            ' Whether or not the exception was thrown, the current
            ' thread owns the mutex, and must release it.
            '
            If ex.Mutex IsNot Nothing Then
 ex.Mutex.ReleaseMutex()            
        End Try

        ' Use two more of the abandoned mutexes for the WaitAll call.
        ' WaitAll doesn't return until all wait handles are signaled
,
        ' so the ManualResetEvent must be signaled by calling Set().
 
        _dummy.Set()
        waitFor(1) = _orphan4
        waitFor(2) = _orphan5

        ' The signaled event and the two abandoned mutexes satisfy
        ' the wait condition for WaitAll, but on return it throws
        ' AbandonedMutexException. For WaitAll, the MutexIndex
        ' property is always -1 and the Mutex property is always
        ' Nothing.
        '  
        Try
            WaitHandle.WaitAll(waitFor)
            Console.WriteLine("WaitAll succeeded.")
        Catch ex As AbandonedMutexException
            Console.WriteLine("Exception on return from WaitAll.
 MutexIndex = " _
                & ex.MutexIndex & "." _
                & vbCrLf & vbTab & "Message: "
 _
                & ex.Message) 
        Finally
            ' Whether or not the exception was thrown, the current
            ' thread owns the mutexes, and must release them.
            '
            CType(waitFor(1), Mutex).ReleaseMutex()
            CType(waitFor(2), Mutex).ReleaseMutex()
        End Try
    End Sub

    <MTAThread> _
    Public Shared Sub AbandonMutex()
        _orphan1.WaitOne()
        _orphan2.WaitOne()
        _orphan3.WaitOne()
        _orphan4.WaitOne()
        _orphan5.WaitOne()
        ' Abandon the mutexes by exiting without releasing them.
        Console.WriteLine("Thread exits without releasing the
 mutexes.")
    End Sub
End Class

' This code example produces the following output:
'
'Thread exits without releasing the mutexes.
'Exception on return from WaitOne.
'        Message: The wait completed due to an abandoned mutex.
'Exception on return from WaitAny at index 1.
'        Message: The wait completed due to an abandoned mutex.
'Exception on return from WaitAll. MutexIndex = -1.
'        Message: The wait completed due to an abandoned mutex.
using System;
using System.Threading;

public class Example
{
    private static ManualResetEvent _dummy
 = new ManualResetEvent(false);

    private static Mutex _orphan1 = new
 Mutex();
    private static Mutex _orphan2 = new
 Mutex();
    private static Mutex _orphan3 = new
 Mutex();
    private static Mutex _orphan4 = new
 Mutex();
    private static Mutex _orphan5 = new
 Mutex();

    [MTAThread]
    public static void Main()
    {
        // Start a thread that takes all five mutexes, and then
        // ends without releasing them.
        //
        Thread t = new Thread(new ThreadStart(AbandonMutex));
        t.Start();
        // Make sure the thread is finished.
        t.Join();

        // Wait on one of the abandoned mutexes. The WaitOne returns
        // immediately, because its wait condition is satisfied by
        // the abandoned mutex, but on return it throws
        // AbandonedMutexException.
        try
        {
            _orphan1.WaitOne();
            Console.WriteLine("WaitOne succeeded.");
        }
        catch(AbandonedMutexException ex)
        {
            Console.WriteLine("Exception on return from WaitOne."
 +
                "\r\n\tMessage: {0}", ex.Message);
        }
        finally
        {
            // Whether or not the exception was thrown, the current
            // thread owns the mutex, and must release it.
            //
            _orphan1.ReleaseMutex();
        }

        // Create an array of wait handles, consisting of one
        // ManualResetEvent and two mutexes, using two more of the
        // abandoned mutexes.
        WaitHandle[] waitFor = {_dummy, _orphan2, _orphan3};

        // WaitAny returns when any of the wait handles in the 
        // array is signaled, so either of the two abandoned mutexes
        // satisfy its wait condition. On returning from the wait,
        // WaitAny throws AbandonedMutexException. The MutexIndex
        // property returns the lower of the two index values for 
        // the abandoned mutexes. Note that the Try block and the
        // Catch block obtain the index in different ways.
        //  
        try
        {
            int index = WaitHandle.WaitAny(waitFor);
            Console.WriteLine("WaitAny succeeded.");

            // The current thread owns the mutex, and must release
            // it.
            Mutex m = waitFor[index] as Mutex;
            if (m != null) m.ReleaseMutex();
        }
        catch(AbandonedMutexException ex)
        {
            Console.WriteLine("Exception on return from WaitAny
 at index {0}." +
                "\r\n\tMessage: {1}", ex.MutexIndex, ex.Message);

            // Whether or not the exception was thrown, the current
            // thread owns the mutex, and must release it.
            //
            if (ex.Mutex != null) ex.Mutex.ReleaseMutex();
        }

        // Use two more of the abandoned mutexes for the WaitAll call.
        // WaitAll doesn't return until all wait handles are signaled
,
        // so the ManualResetEvent must be signaled by calling Set().
        _dummy.Set();
        waitFor[1] = _orphan4;
        waitFor[2] = _orphan5;

        // The signaled event and the two abandoned mutexes satisfy
        // the wait condition for WaitAll, but on return it throws
        // AbandonedMutexException. For WaitAll, the MutexIndex
        // property is always -1 and the Mutex property is always
        // null.
        //  
        try
        {
            WaitHandle.WaitAll(waitFor);
            Console.WriteLine("WaitAll succeeded.");
        }
        catch(AbandonedMutexException ex)
        {
            Console.WriteLine("Exception on return from WaitAll.
 MutexIndex = {0}." +
                "\r\n\tMessage: {1}", ex.MutexIndex, ex.Message);
        }
        finally
        {
            // Whether or not the exception was thrown, the current
            // thread owns the mutexes, and must release them.
            //
            _orphan4.ReleaseMutex();
            _orphan5.ReleaseMutex();
        }
    }

    [MTAThread]
    public static void AbandonMutex()
    {
        _orphan1.WaitOne();
        _orphan2.WaitOne();
        _orphan3.WaitOne();
        _orphan4.WaitOne();
        _orphan5.WaitOne();
        // Abandon the mutexes by exiting without releasing them.
        Console.WriteLine("Thread exits without releasing the mutexes.");
    }
}

/* This code example produces the following output:

Thread exits without releasing the mutexes.
Exception on return from WaitOne.
        Message: The wait completed due to an abandoned mutex.
Exception on return from WaitAny at index 1.
        Message: The wait completed due to an abandoned mutex.
Exception on return from WaitAll. MutexIndex = -1.
        Message: The wait completed due to an abandoned mutex.
 */
using namespace System;
using namespace System::Threading;

namespace SystemThreadingExample
{
    public ref class Example
    {
    private:
        static ManualResetEvent^ dummyEvent = 
            gcnew ManualResetEvent(false);
            
        static Mutex^ orphanMutex1 = gcnew Mutex;
        static Mutex^ orphanMutex2 = gcnew Mutex;
        static Mutex^ orphanMutex3 = gcnew Mutex;
        static Mutex^ orphanMutex4 = gcnew Mutex;
        static Mutex^ orphanMutex5 = gcnew Mutex;
        
    public:
        static void ProduceAbandonMutexException(void)
        {
            
            // Start a thread that grabs all five mutexes, and then
            // abandons them.
            Thread^ abandonThread = 
                gcnew Thread(gcnew ThreadStart(AbandonMutex));

            abandonThread->Start();
            
            // Make sure the thread is finished.
            abandonThread->Join();
            
            // Wait on one of the abandoned mutexes. The WaitOne
            // throws an AbandonedMutexException.
            try
            {
                orphanMutex1->WaitOne();
                Console::WriteLine("WaitOne succeeded.");
            }
            catch (AbandonedMutexException^ ex) 
            {
                Console::WriteLine("Exception in WaitOne:
 {0}", 
                    ex->Message);
            }
            finally
            {
                
                // Whether or not the exception was thrown, 
                // the current thread owns the mutex, and 
                // must release it.
                orphanMutex1->ReleaseMutex();
            }

            
            // Create an array of wait handles, consisting of one
            // ManualResetEvent and two mutexes, using two more of
            // the abandoned mutexes.
            array <WaitHandle^>^ waitFor = {dummyEvent, 
                orphanMutex2, orphanMutex3};
            
            // WaitAny returns when any of the wait handles in the 
            // array is signaled. Either of the two abandoned mutexes
            // satisfy the wait, but lower of the two index values is
            // returned by MutexIndex. Note that the Try block and
            // the Catch block obtain the index in different ways.
            try
            {
                int index = WaitHandle::WaitAny(waitFor);
                Console::WriteLine("WaitAny succeeded.");
                (safe_cast<Mutex^>(waitFor[index]))->ReleaseMutex();
            }
            catch (AbandonedMutexException^ ex) 
            {
                Console::WriteLine("Exception in WaitAny
 at index {0}"
                    "\r\n\tMessage: {1}", ex->MutexIndex, 
                    ex->Message);
                (safe_cast<Mutex^>(waitFor[ex->MutexIndex]))->
                    ReleaseMutex();
            }

            orphanMutex3->ReleaseMutex();
            
            // Use two more of the abandoned mutexes for the WaitAll
 
            // call. WaitAll doesn't return until all wait handles 
            // are signaled, so the ManualResetEvent must be signaled
 
            // by calling Set().
            dummyEvent->Set();
            waitFor[1] = orphanMutex4;
            waitFor[2] = orphanMutex5;
            
            // Because WaitAll requires all the wait handles to be
            // signaled, both mutexes must be released even if the
            // exception is thrown. Thus, the ReleaseMutex calls are
 
            // placed in the Finally block. Again, MutexIndex returns
            // the lower of the two index values for the abandoned
            // mutexes.
            //  
            try
            {
                WaitHandle::WaitAll(waitFor);
                Console::WriteLine("WaitAll succeeded.");
            }
            catch (AbandonedMutexException^ ex) 
            {
                Console::WriteLine("Exception in WaitAny
 at index {0}"
                    "\r\n\tMessage: {1}", ex->MutexIndex, 
                    ex->Message);
            }
            finally
            {
                orphanMutex4->ReleaseMutex();
                orphanMutex5->ReleaseMutex();
            }

        }


    private:
        [MTAThread]
        static void AbandonMutex()
        {
            orphanMutex1->WaitOne();
            orphanMutex2->WaitOne();
            orphanMutex3->WaitOne();
            orphanMutex4->WaitOne();
            orphanMutex5->WaitOne();
            Console::WriteLine(
                "Thread exits without releasing the mutexes.");
        }
    };   
}

//Entry point of example application
[MTAThread]
int main(void)
{
    SystemThreadingExample::Example::ProduceAbandonMutexException();
}

// This code example produces the following output:
// Thread exits without releasing the mutexes.
// Exception in WaitOne: The wait completed due to an abandoned mutex.
// Exception in WaitAny at index 1
//         Message: The wait completed due to an abandoned mutex.
// Exception in WaitAll at index -1
//         Message: The wait completed due to an abandoned mutex.

import System.*;
import System.Threading.*;

public class Example
{
    private static ManualResetEvent dummy =
 new ManualResetEvent(false);
    private static Mutex orphan1 = new
 Mutex();
    private static Mutex orphan2 = new
 Mutex();
    private static Mutex orphan3 = new
 Mutex();
    private static Mutex orphan4 = new
 Mutex();
    private static Mutex orphan5 = new
 Mutex();

    /** @attribute MTAThread()
     */
    public static void main(String[]
 args)
    {
        // Start a thread that takes all five mutexes, and then
        // ends without releasing them.
        //
        System.Threading.Thread t = new System.Threading.Thread(new
 
            ThreadStart(AbandonMutex));
        t.Start();
        // Make sure the thread is finished.
        t.Join();

        // Wait on one of the abandoned mutexes. The WaitOne returns
        // immediately, because its wait condition is satisfied by
        // the abandoned mutex, but on return it throws
        // AbandonedMutexException.
        try {
            orphan1.WaitOne();
            Console.WriteLine("WaitOne succeeded.");
        }
        catch (AbandonedMutexException ex) {
            Console.WriteLine("Exception on return from WaitOne."
 +
                "\r\n\tMessage: {0}", ex.get_Message());
        }
        finally {
            // Whether or not the exception was thrown, the current
            // thread owns the mutex, and must release it.
            //
            orphan1.ReleaseMutex();
        }
        // Create an array of wait handles, consisting of one
        // ManualReset_Event and two mutexes, using two more of the
        // abandoned mutexes.
        WaitHandle waitFor[] =  { dummy, orphan2, orphan3 };

        // WaitAny returns when any of the wait handles in the 
        // array is signaled, so either of the two abandoned mutexes
        // satisfy its wait condition. On returning from the wait,
        // WaitAny throws AbandonedMutexException. The MutexIndex
        // property returns the lower of the two index values for 
        // the abandoned mutexes. Note that the Try block and the
        // Catch block obtain the index in different ways.
        //  
        try {
            int index = WaitHandle.WaitAny(waitFor);
            Console.WriteLine("WaitAny succeeded.");
            if (waitFor.get_Item(index) instanceof Mutex) {
                ((Mutex)(waitFor.get_Item(index))).ReleaseMutex();
            }
        }
        catch (AbandonedMutexException ex) {
            Console.WriteLine("Exception on return from WaitAny
 at index {0}" 
                + "\r\n\tMessage: {1}", (Int32)ex.get_MutexIndex(),
                ex.get_Message());

            // Whether or not the exception was thrown, the current
            // thread owns the mutex, and must release it.
            //
            if (ex.get_Mutex() != null) ex.get_Mutex().ReleaseMutex();
        }

        // Use two more of the abandoned mutexes for the WaitAll call.
        // WaitAll doesn't return until all wait handles are signaled
,
        // so the ManualReset_Event must be signaled by calling set_().
        dummy.Set();
        waitFor.set_Item(1, orphan4);
        waitFor.set_Item(2, orphan5);

        // The signaled event and the two abandoned mutexes satisfy
        // the wait condition for WaitAll, but on return it throws
        // AbandonedMutexException. For WaitAll, the MutexIndex
        // property is always -1 and the Mutex property is always
        // null.
        //  
        try {
            WaitHandle.WaitAll(waitFor);
            Console.WriteLine("WaitAll succeeded.");
        }
        catch (AbandonedMutexException ex) {
            Console.WriteLine("Exception on return from WaitAny
 at index {0}" 
                + "\r\n\tMessage: {1}", (Int32)ex.get_MutexIndex(),
                ex.get_Message());
        }
        finally {
            // Whether or not the exception was thrown, the current
            // thread owns the mutexes, and must release them.
            //
            orphan4.ReleaseMutex();
            orphan5.ReleaseMutex();
        }
    } //main

    /** @attribute MTAThread()
     */
    public static void AbandonMutex()
    {
        orphan1.WaitOne();
        orphan2.WaitOne();
        orphan3.WaitOne();
        orphan4.WaitOne();
        orphan5.WaitOne();
        // Abandon the mutexes by exiting without releasing them.
        Console.WriteLine("Thread exits without releasing the mutexes.");
    } //AbandonMutex
} //Example

/* This code example produces the following output:

Thread exits without releasing the mutexes.
Exception on return from WaitOne.
        Message: The wait completed due to an abandoned mutex.
Exception on return from WaitAny at index 1.
        Message: The wait completed due to an abandoned mutex.
Exception on return from WaitAll. MutexIndex = -1.
        Message: The wait completed due to an abandoned mutex.
 */
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
      System.Threading.AbandonedMutexException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ ()

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

AbandonedMutexException クラス新しインスタンス既定値初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As New AbandonedMutexException
public AbandonedMutexException ()
public:
AbandonedMutexException ()
public AbandonedMutexException ()
public function AbandonedMutexException ()
解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ (SerializationInfo, StreamingContext)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

シリアル化したデータ使用して、AbandonedMutexException クラス新しインスタンス初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Protected Sub New ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
Dim info As SerializationInfo
Dim context As StreamingContext

Dim instance As New AbandonedMutexException(info,
 context)
protected AbandonedMutexException (
    SerializationInfo info,
    StreamingContext context
)
protected:
AbandonedMutexException (
    SerializationInfo^ info, 
    StreamingContext context
)
protected AbandonedMutexException (
    SerializationInfo info, 
    StreamingContext context
)
protected function AbandonedMutexException
 (
    info : SerializationInfo, 
    context : StreamingContext
)

パラメータ

info

スローされている例外に関するシリアル化済みオブジェクト データ保持している SerializationInfo オブジェクト

context

転送元または転送先に関す文脈情報含んでいる StreamingContext オブジェクト

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ (String, Int32, WaitHandle)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

エラー メッセージ放棄されミューテックスインデックス指定する場合はそのインデックス、および放棄されミューテックス指定して、AbandonedMutexException クラス新しインスタンス初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    message As String, _
    location As Integer, _
    handle As WaitHandle _
)
Dim message As String
Dim location As Integer
Dim handle As WaitHandle

Dim instance As New AbandonedMutexException(message,
 location, handle)
public AbandonedMutexException (
    string message,
    int location,
    WaitHandle handle
)
public:
AbandonedMutexException (
    String^ message, 
    int location, 
    WaitHandle^ handle
)
public AbandonedMutexException (
    String message, 
    int location, 
    WaitHandle handle
)
public function AbandonedMutexException (
    message : String, 
    location : int, 
    handle : WaitHandle
)

パラメータ

message

例外原因説明するエラー メッセージ

location

System.Threading.WaitHandle.WaitAny メソッド例外スローされる場合は、待機ハンドル配列における放棄されミューテックスインデックス。System.Threading.WaitHandle.WaitOne メソッドまたは WaitAll メソッド例外スローされる場合は -1。

handle

放棄されミューテックスを表す Mutex オブジェクト

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ (String, Exception, Int32, WaitHandle)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

エラー メッセージ内部例外放棄されミューテックスインデックス指定する場合はそのインデックス、およびミューテックスを表す Mutex オブジェクト指定して、AbandonedMutexException クラス新しインスタンス初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    message As String, _
    inner As Exception, _
    location As Integer, _
    handle As WaitHandle _
)
public AbandonedMutexException (
    string message,
    Exception inner,
    int location,
    WaitHandle handle
)
public:
AbandonedMutexException (
    String^ message, 
    Exception^ inner, 
    int location, 
    WaitHandle^ handle
)
public AbandonedMutexException (
    String message, 
    Exception inner, 
    int location, 
    WaitHandle handle
)
public function AbandonedMutexException (
    message : String, 
    inner : Exception, 
    location : int, 
    handle : WaitHandle
)

パラメータ

message

例外原因説明するエラー メッセージ

inner

現在の例外の原因である例外inner パラメータnull 参照 (Visual Basic では Nothing) でない場合は、内部例外処理する catch ブロック現在の例外が発生します

location

System.Threading.WaitHandle.WaitAny メソッド例外スローされる場合は、待機ハンドル配列における放棄されミューテックスインデックス。System.Threading.WaitHandle.WaitOne メソッドまたは WaitAll メソッド例外スローされる場合は -1。

handle

放棄されミューテックスを表す Mutex オブジェクト

解説解説

message内容は、例外に関する情報ユーザー伝えるためのテキスト文字列です。このコンストラクタ呼び出し元は、この文字列現在のシステムのカルチャに合わせてローカライズ済みであることを確認しておく必要があります

前の例外直接結果としてスローされる例外については、InnerException プロパティに、前の例外への参照格納されます。InnerException プロパティは、コンストラクタ渡されたものと同じ値を返しますInnerException プロパティによって内部例外値がコンストラクタ渡されなかった場合は、null 参照 (Visual Basic では Nothing) を返します

このコンストラクタ使用して初期化する AbandonedMutexExceptionインスタンス初期プロパティ値を次の表に示します

プロパティ

InnerException

inner

Message

message

Mutex

handle

MutexIndex

location

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ (String, Exception)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

AbandonedMutexException クラス新しインスタンスを、指定したエラー メッセージ内部例外使用して初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

message内容は、ユーザー理解できる内容にします。このコンストラクタ呼び出し元は、この文字列現在のシステムのカルチャに合わせてローカライズ済みであることを確認しておく必要があります

前の例外直接結果としてスローされる例外については、InnerException プロパティに、前の例外への参照格納されます。InnerException プロパティは、コンストラクタ渡されたものと同じ値を返しますInnerException プロパティによって内部例外値がコンストラクタ渡されなかった場合は、null 参照 (Visual Basic では Nothing) を返します

このコンストラクタ使用して初期化する AbandonedMutexExceptionインスタンス初期プロパティ値を次の表に示します

プロパティ

InnerException

inner

Message

message

Mutex

null 参照 (Visual Basic では Nothing)。

MutexIndex

–1 (マイナス 1)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ (String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したエラー メッセージ使用して、AbandonedMutexException クラス新しインスタンス初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim message As String

Dim instance As New AbandonedMutexException(message)
public AbandonedMutexException (
    string message
)
public:
AbandonedMutexException (
    String^ message
)
public AbandonedMutexException (
    String message
)
public function AbandonedMutexException (
    message : String
)

パラメータ

message

例外原因説明するエラー メッセージ

解説解説

message内容は、ユーザー理解できる内容にします。このコンストラクタ呼び出し元は、この文字列現在のシステムのカルチャに合わせてローカライズ済みであることを確認しておく必要があります

このコンストラクタ使用して初期化する AbandonedMutexExceptionインスタンス初期プロパティ値を次の表に示します

プロパティ

InnerException

null 参照 (Visual Basic では Nothing)。

Message

message

Mutex

null 参照 (Visual Basic では Nothing)。

MutexIndex

–1 (マイナス 1)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException コンストラクタ

AbandonedMutexException クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
AbandonedMutexException () AbandonedMutexException クラス新しインスタンス既定値初期化します。
AbandonedMutexException (String) 指定したエラー メッセージ使用してAbandonedMutexException クラス新しインスタンス初期化します。
AbandonedMutexException (Int32, WaitHandle) 放棄されミューテックスインデックス指定する場合はそのインデックスと、ミューテックスを表す Mutex オブジェクト指定してAbandonedMutexException クラス新しインスタンス初期化します。
AbandonedMutexException (SerializationInfo, StreamingContext) シリアル化したデータ使用してAbandonedMutexException クラス新しインスタンス初期化します。
AbandonedMutexException (String, Exception) AbandonedMutexException クラス新しインスタンスを、指定したエラー メッセージ内部例外使用して初期化します。
AbandonedMutexException (String, Int32, WaitHandle) エラー メッセージ放棄されミューテックスインデックス指定する場合はそのインデックス、および放棄されミューテックス指定してAbandonedMutexException クラス新しインスタンス初期化します。
AbandonedMutexException (String, Exception, Int32, WaitHandle) エラー メッセージ内部例外放棄されミューテックスインデックス指定する場合はそのインデックス、およびミューテックスを表す Mutex オブジェクト指定してAbandonedMutexException クラス新しインスタンス初期化します。
参照参照

関連項目

AbandonedMutexException クラス
AbandonedMutexException メンバ
System.Threading 名前空間
Mutex

その他の技術情報

ミューテックス

AbandonedMutexException コンストラクタ (Int32, WaitHandle)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

放棄されミューテックスインデックス指定する場合はそのインデックスと、ミューテックスを表す Mutex オブジェクト指定して、AbandonedMutexException クラス新しインスタンス初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    location As Integer, _
    handle As WaitHandle _
)
Dim location As Integer
Dim handle As WaitHandle

Dim instance As New AbandonedMutexException(location,
 handle)
public AbandonedMutexException (
    int location,
    WaitHandle handle
)
public:
AbandonedMutexException (
    int location, 
    WaitHandle^ handle
)
public AbandonedMutexException (
    int location, 
    WaitHandle handle
)
public function AbandonedMutexException (
    location : int, 
    handle : WaitHandle
)

パラメータ

location

System.Threading.WaitHandle.WaitAny メソッド例外スローされる場合は、待機ハンドル配列内における放棄されミューテックスインデックス。WaitOne メソッドまたは WaitAll メソッド例外スローされる場合は -1。

handle

放棄されミューテックスを表す Mutex オブジェクト

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AbandonedMutexException プロパティ


パブリック プロパティパブリック プロパティ

プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ HResult  特定の例外割り当てられているコード化数値である HRESULT を取得または設定します。 ( Exception から継承されます。)
参照参照

関連項目

AbandonedMutexException クラス
System.Threading 名前空間
Mutex

その他の技術情報

ミューテックス

AbandonedMutexException メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

AbandonedMutexException クラス
System.Threading 名前空間
Mutex

その他の技術情報

ミューテックス

AbandonedMutexException メンバ

スレッドが、別のスレッド解放せずに終了することによって放棄した Mutex オブジェクト取得したときにスローされる例外

AbandonedMutexException データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド AbandonedMutexException オーバーロードされますAbandonedMutexException クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ HResult  特定の例外割り当てられているコード化数値である HRESULT を取得または設定します。(Exception から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

AbandonedMutexException クラス
System.Threading 名前空間
Mutex

その他の技術情報

ミューテックス


このページでは「.NET Framework クラス ライブラリ リファレンス」からAbandonedMutexExceptionを検索した結果を表示しています。
Weblioに収録されているすべての辞書からAbandonedMutexExceptionを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からAbandonedMutexExceptionを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「AbandonedMutexException」の関連用語

AbandonedMutexExceptionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AbandonedMutexExceptionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS