回答編集履歴
1
改行
answer
CHANGED
@@ -1,29 +1,20 @@
|
|
1
|
-
こんにちは。
|
1
|
+
こんにちは。
|
2
|
-
|
3
2
|
なんか少しディープですね…
|
4
3
|
|
5
|
-
以下予想です。
|
4
|
+
以下予想です。
|
6
5
|
ご存じかもしれませんが、背景としてWindowsフォームのコントロールはUIスレッドからしか操作できません。
|
7
6
|
|
8
|
-
その関係でフォームの生成時には、WindowsFormsSynchronizationContextの設定が走ります。
|
7
|
+
その関係でフォームの生成時には、WindowsFormsSynchronizationContextの設定が走ります。
|
8
|
+
おそらく、そのタイミングでTheadContext.MarshalingControlにアクセスするんですが
|
9
|
+
こいつがスレッドセーフな作りになっているのでスレッド間で待機し合うのではないかと。
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
<参考>
|
12
|
+
WindowsFormsSynchronizationContext.Constructor
|
13
|
+
[http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/WindowsFormsSynchronizationContext.cs,d37865bac8deb498 ](http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/WindowsFormsSynchronizationContext.cs,d37865bac8deb498 )
|
12
14
|
|
13
|
-
|
15
|
+
Application.TheadContext.MarshalingControl
|
16
|
+
[http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Application.cs,150fc91c7f8e7176 ](http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Application.cs,150fc91c7f8e7176 )
|
14
17
|
|
15
|
-
WindowsFormsSynchronizationContext.Constructor
|
16
|
-
|
17
|
-
http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/WindowsFormsSynchronizationContext.cs,d37865bac8deb498
|
18
|
-
|
19
|
-
|
20
|
-
Application.TheadContext.MarshalingControl
|
21
|
-
|
22
|
-
http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Application.cs,150fc91c7f8e7176
|
23
|
-
|
24
|
-
|
25
|
-
ということで、私の予想では
|
18
|
+
ということで、私の予想では
|
26
|
-
|
27
|
-
質問者さんの推察どおり、「フォーム生成時にリソースロックしているため。」です。
|
19
|
+
質問者さんの推察どおり、「フォーム生成時にリソースロックしているため。」です。
|
28
|
-
|
29
20
|
間違ってたらすみません!
|