In This Session, You Will Learn To:: Objectives
In This Session, You Will Learn To:: Objectives
Objectives
A thread or
execution context
Blocked Dead
New
Unblocked Event Blocked
}catch (InterruptedException e)
{
// This thread’s sleep was interrupted by another
thread
}}}}
Ver. 1.0 Session 13 Slide 7 of 24
Java Programming Language
Terminating a Thread
Test Threads:
isAlive()
Access Thread Priority:
getPriority()
setPriority()
Put Threads on Hold:
Thread.sleep() // static method
join()
Thread.yield() // static method
Object this
lock flag missing Another thread, trying to execute
synchronized(this)
Waiting for
public char pop(char c)
object lock {
synchronized(this)
{
idx--;
return data[idx];
}
}
Blocked Dead
New
Unblocked Event Blocked
Synchronized
Lock Acquired Blocked in
Object’s Lock
Pool
Blocked
New Dead
Unblocked Event Blocked