[Mono-devel-list] Emdedded mono: Finding out if we are inside a C#

Gonzalo Paniagua Javier gonzalo at ximian.com
Tue Aug 31 17:19:09 EDT 2004


On Mon, 2004-08-30 at 10:17, Joe Ante wrote:
> Hi,
> 
> Is there a way to find out if we we are currently inside a mono function
> from C?
> 
> At the moment i have a global variable that i set before entering a mono
> function using mono_runtime_invoke.
> 
> int gInsideMono = 0;
> 
> gInsideMono++;
> mono_runtime_invoke
> gInsideMono--;
> 
> It's obviously not a very good solution so i wonder if there  isn't a mono
> function i can ask if we are inside a mono function?

There's a mono_stack_walk function. You can see how it's used in
icall.c.

-Gonzalo





More information about the Mono-devel-list mailing list