Code example for Thread

Methods: join

0
 
        mRunning = true;
 
        try 
        { 
            mThread.join();
        } catch (InterruptedException e) {}
        mThread = null;
    } 
 
 
    public void run() 
    { 
        while (mRunning)
        { 
            for (int i = 0; i < NUM_ROOMS; i++)
                updateRoomStatus(i);
 
            try 
            { 
                Thread.sleep(TIME_FOR_A_REST);