[Mono-dev] About your changes to type initialization

Rodrigo Kumpera kumpera at gmail.com
Thu Mar 4 10:14:50 EST 2010

Hi Martin,

You change in r152558 is wrong, the test you committed doesn't work on MS.
Type constructors must no be run multiple time, even under a debugging
session, as
this is an assumption made by most developers that we can't break.

The solution for your problem is to tag the thread as doing a .cctor
invocation and do the abort
right after it finishes. This is cleaner, correct and use less memory.

You might ask what should happen is the .cctor blocks for way too long,
well, the solution then
is to interrupt the thread and accept the fact that the debugging session
went south.

I attached a reworked version of your test that has more console spew and
shows up clearly the issue.

If you could better state the problem you're trying to solve we'll be better
able to help you fixing it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100304/eb85cbef/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abort-invoke.cs
Type: application/octet-stream
Size: 1370 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100304/eb85cbef/attachment.obj 

More information about the Mono-devel-list mailing list