Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
cin
- Tue, 23 Dec 2014 00:20:39
Show More
0
Implab/ComponentContainer.cs
Implab/ComponentContainer.cs
created
644
+48
0
@@
-0,0
+1,48
1
using System ;
2
using Implab.Parallels ;
3
using System.Threading ;
4
5
namespace Implab {
6
public class ComponentContainer : IComponentContainer , IDisposable {
7
static readonly ComponentContainer _appContainer ;
8
9
static ComponentContainer () {
10
_appContainer = new ComponentContainer ();
11
AppDomain . CurrentDomain . ProcessExit += HandleProcessExit ;
12
}
13
14
public static ComponentContainer Global {
15
get {
16
return _appContainer ;
17
}
18
}
19
20
bool m_disposed ;
21
readonly MTQueue < IDisposable > m_components = new MTQueue < IDisposable >();
22
23
public void Add ( IDisposable item ) {
24
Safe . ArgumentNotNull ( item , "item" );
25
Thread . MemoryBarrier ();
26
if ( m_disposed ) {
27
item . Dispose ();
28
} else {
29
m_components . Enqueue ( item );
30
if ( m_disposed && m_components . TryDequeue ( out item ))
31
item . Dispose ();
32
}
33
}
34
35
public void Dispose () {
36
m_disposed = true ;
37
IDisposable item ;
38
while ( m_components . TryDequeue ( out item ))
39
item . Dispose ();
40
}
41
42
static void HandleProcessExit ( object sender , EventArgs e )
43
{
44
_appContainer . Dispose ();
45
}
46
}
47
}
48
0
.hgignore
.hgignore
+1
0
@@
-14,3
+14,4
Implab.Fx.Test/obj/
14
14
Implab.Diagnostics.Interactive/bin/
15
15
Implab.Diagnostics.Interactive/obj/
16
16
MonoPlay/bin/
17
MonoPlay/obj/
0
Implab/Implab.csproj
Implab/Implab.csproj
+1
-1
@@
-146,10
+146,10
146
146
<Compile Include="Diagnostics\LogEventArgsT.cs" />
147
147
<Compile Include="Diagnostics\Extensions.cs" />
148
148
<Compile Include="IComponentContainer.cs" />
149
<Compile Include="MTComponentContainer.cs" />
150
149
<Compile Include="PromiseEventType.cs" />
151
150
<Compile Include="Parallels\MTCustomQueue.cs" />
152
151
<Compile Include="Parallels\MTCustomQueueNode.cs" />
152
<Compile Include="ComponentContainer.cs" />
153
153
</ItemGroup>
154
154
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
155
155
<ItemGroup />
0
Implab/MTComponentContainer.cs
Implab/MTComponentContainer.cs
removed
0
-48
1
NO CONTENT: file was removed
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages