X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fembedded-api;h=3b405c98ddd191575e917267cc3f469c39528146;hb=feca28835d4e3cb2be67bdcbd4f54fee62c3797a;hp=9347c0f219aec80f4835ee6144939184ed71eec1;hpb=c05310babad165284c4b52b3e002cb7d226b08ba;p=mono.git diff --git a/web/embedded-api b/web/embedded-api index 9347c0f219a..3b405c98ddd 100755 --- a/web/embedded-api +++ b/web/embedded-api @@ -68,9 +68,20 @@ not interfere with code in other domains. This is useful if you want to host different applications in your program. - Then you can load an assembly containing code into the domain: + Now, it is necessary to transfer control to Mono, and setup + the threading infrastructure, you do this like this:
+ void *user_data = NULL; + + mono_runtime_exec_managed_code (domain, main_thread_handler, user_data); ++ + Where your main_thread_handler can load your assembly and execute it: + +
+ static void main_thread_handler (gpointer user_data) + { MonoAssembly *assembly; assembly = mono_domain_assembly_open (domain, "file.dll"); @@ -107,7 +118,11 @@ The Boehm GC system needs to catch your calls to the pthreads layer, so in each file where you use pthread.h you should - include thefile. + include the <gc/gc.h> file. + + If you can not do this for any reasons, just remember that you + can not store pointers to Mono Objects on the stack, you can + store them safely in the heap, or in global variables though * Exposing C code to the CIL universe