回答編集履歴

1

改行

2015/12/04 02:10

投稿

Tak1wa
Tak1wa

スコア4791

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