join() public method

public join ( ) : void
return void
Example #1
0
        private static void Main()
        {
            Init();

            // that's CLR implementation of Java interface
            // java.lang.Runnable have it's proxy in jni4net
            // you could wrap any interface same way
            CLRRunnable clrRunnable = new CLRRunnable {Message = "I'm callback"};

            // we generated CLR proxy for java.lang.Thread as part of this demo, because it could accept Runnable
            // generate proxy for your own class/method which could accept Runnable interface
            Thread javaThread = new Thread(clrRunnable);
            javaThread.start();
            javaThread.join();
        }
        //*******************************************************************//
        //* Called when leaving the page.
        //*******************************************************************//
        public void stop()
        {
            if (fThread == null)
                return;

            if (!fThread.isAlive())
                return;

            fThread = null;

            try
            {
                fThread.join();
            }
            catch
            {

            }

            // fThread.stop();
            
        }