[Mono-dev] (Delegate) Trampoline executed twice?
robertj at gmx.net
Tue Dec 7 04:54:12 EST 2010
On 07.12.2010 08:52, Martin Däumler wrote:
> On 06.12.10 06:29 pm, mabra at manfbraun.de wrote:
>> That's a problem of your code:You first create a ThreadStart
>> delegate and execute it via "Invoke" [!!!!!] and the you start
>> the thread, which run the same code!! Do you see? Why do you
>> do call the invoke method on the thread start delegate, please?
> I should have mentioned that this is an uncommon example.
> I expected a delegate trampoline to be executed only once
> like "common" JIT trampolines for a single call instruction.
> However, it might be executed twice.
It could be related to the fact that the code behind
Thread.Start () is eventually calling delegate's Invoke
method via mono_runtime_invoke ().
You may want to test if your runtime modifications
are able to deal with reflection calls, respectively
with their wrappers.
More information about the Mono-devel-list