For example, when a car is started it can go into both the Engine Running state and the Emiting Pollution state. When an object reaches a final transition , it ceases to exist only if no other states of that object are on. All states of an object must be off before the object ceases to exist or before it ceases to be a member of a class. In this example, a runner can also quit running and still be listening to music. In order for a person to cease existing, all threads of execution must be terminated by either reaching a final transition, or by being turned off by an exception.
Threads can also join together in several ways.
As the example below shows, a person can be in the Inside Theater state, execute another thread to enter the Buying Candy state, and join the threads again in the Inside Theater state. Whenever there is a transition to an atomic state that is already on, the joining thread is lost and the state remains on. This example assumes that in the action for the transition whose trigger is Movie over there is a clause When ready, exit building or some other action that restricts the Outside Theater state from being turned on until the Buying Candy state has been turned off and the thread absorbed into the Inside Theater state. The other case where threads can join is if multiple states need to be on for a transition to fire. For example, suppose a person needs to be in the Inside Grocery Store state and in the Have Money state before he can enter the At Checkout Counter state.