[Mono-dev] Finalizers in CriticalHandle

Dick Porter dporter at codicesoftware.com
Thu Jan 20 11:15:35 EST 2011


On 17 Jan 2011, at 6:00PM, Rodrigo Kumpera wrote:
> I'm not sure what the defined behavior is on this case, MSDN is not  
> always accurate and we
> need to be as compatible with MS as possible.
>
> Could you please write a test case, and if the behavior you suggest  
> is correct, send a patch
> which includes both the fix and the test case so we can move forward?

Please see attached test case and diff.

Test case on windows:

C:\Documents and Settings\Administrator\Desktop\CriticalHandle 
\CriticalHandle\bin\Debug>CriticalHandle.exe
Handle 8 was released!
Handle 3 was released!
Handle 2 was released!
Handle 1 was released!
Handle 0 was released!
Handle 7 was released!
Handle 6 was released!
Handle 5 was released!
Handle 4 was released!

Handle 9 was released!

C:\Documents and Settings\Administrator\Desktop\CriticalHandle 
\CriticalHandle\bin\Debug>


Test case on unpatched mono, git master as of this afternoon:

[dick at hagbard /tmp] [ 3:53PM] Mono HEAD
:; mono CriticalHandleTest.exe


[dick at hagbard /tmp] [ 3:53PM] Mono HEAD
:; mono-sgen CriticalHandleTest.exe


[dick at hagbard /tmp] [ 3:54PM] Mono HEAD
:;


Test case on patched mono:

[dick at hagbard /tmp] [ 4:00PM] Mono HEAD
:; mono CriticalHandleTest.exe
Handle 7 was released!
Handle 1 was released!
Handle 6 was released!
Handle 0 was released!
Handle 5 was released!
Handle 4 was released!
Handle 3 was released!
Handle 2 was released!
Handle 8 was released!

Handle 9 was released!

[dick at hagbard /tmp] [ 4:00PM] Mono HEAD
:; mono-sgen CriticalHandleTest.exe
Handle 8 was released!
Handle 7 was released!
Handle 5 was released!
Handle 6 was released!
Handle 3 was released!
Handle 4 was released!
Handle 2 was released!
Handle 0 was released!
Handle 1 was released!

Handle 9 was released!

[dick at hagbard /tmp] [ 4:00PM] Mono HEAD
:;


- Dick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CriticalHandleTest.cs
Type: application/octet-stream
Size: 1014 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110120/b9c4a9b1/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: criticalhandle.diff
Type: application/octet-stream
Size: 555 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110120/b9c4a9b1/attachment-0001.obj 
-------------- next part --------------




More information about the Mono-devel-list mailing list