On 02/19/03 Victor wrote: > I'm working on a project related to Mono. In this project, I want to > translate a external event (such as timer expires in OS) to an exception > of Mono's managed code:
I dont think using exceptions is the best way to handle that kind of stuff: you can have a thread wait on a semaphore or something like that. > Timer expires-> ISR -> some function in Mono runtime -> exception thrown to Inside unmanged code, you can raise an exception with the function: void mono_raise_exception (MonoException *ex); Just grep for it in the sources and you'll find lots of sample cases. > I found some functions in /mono-0.19/mono/jit/exception.c and > /mono-0.19/mono/jit/codegen-x86.c. I'm wondering if I can call > mono_burg_emit_14() to throw the exception. But I don't know what the > parameters s->code and thre->left->reg1 mean. Definitely no. That is code internal to the implementation of the jit. Using mono_raise_exception () is the API designed to do that. Even better would be if you could keep the runtime in managed code and throw the exception from there, using the normal C# syntax. lupus -- ----------------------------------------------------------------- [EMAIL PROTECTED] debian/rules [EMAIL PROTECTED] Monkeys do it better _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
