Hi.

I'm coding a little app using System.Threading.Thread, and I've seen
that the Suspend() method is not implemented.

I'd like to contribute to Mono, and I think it's a good way, but I need
some help.

Well, that's what I did. Please, tell me what's wrong:

This goes in mcs/class/corlib/System.Threading/Thread.cs

--------------------------------------------

[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern void Suspend_internal();
                                                                                       
                                           public void Suspend() {
   if((state & ThreadState.Unstarted) != 0 || !IsAlive) {
      throw new ThreadStateException("Thread has not been started, or is
dead");
   }
   set_state(ThreadState.SuspendRequested);
   Suspend_internal ();
}

--------------------------------------------

This is mono/mono/metadata/threads.c (just a test function):

--------------------------------------------

void ves_icall_System_Threading_Thread_Suspend_internal ()
{
        g_message("hello world!\n");
}

--------------------------------------------

This is mono/mono/metadata/threads.h:

--------------------------------------------

extern void ves_icall_System_Threading_Thread_Suspend_internal ();

--------------------------------------------

And this is mono/mono/metadata/icall.c, added to icall_map [] :

--------------------------------------------

"System.Threading.Thread::Suspend",
ves_icall_System_Threading_Thread_Suspend_internal,

--------------------------------------------

-- 
                 [EMAIL PROTECTED]|      c~~p ,---------.
[EMAIL PROTECTED]| ,---'oo  )           \
--------------------------------|( O O                  )/
         http://www.es.gnome.org| `=^='                 /
        http://mono.es.gnome.org|       \    ,     .   /
        http://www.hispalinux.es|       \\  |-----'|  /
            Debian GNU/Linux Sid|       ||__|    |_|__|



_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to