There needn't singal or semaphore to sychronize thread.
Since every class in java inherit from the object class, and object implemented the wait() and notify() interface.
So we can use every object as signal to sychronize thread.
Here is an example:
final String signal=new String();
Thread subThread = new Thread(new Runnable(){public void run(){
Log.d("Controller", "subthread");
synchronized(signal){
signal.notify();
}
}
});
Log.d("Controller", "mail thread");
subThread.start();
try{
//Thread.sleep(100);
synchronized(signal){
signal.wait();
}
}catch(InterruptedException e){
Log.d(LOGTAG, "e="+e);
}
Some key point
a. catch InterruptedException in wait()
b. synchronized(signal), every time call it's wait() or notify(), method.
who used as the signal call, who will be used as the parameter of synchronized();