If I create a new thread inside a synchronized block, will the block remain locked until the thread completes? If not, until when will it remain blocked?
String sLine;
onClick(String line){
synchronized (lock) {
sLine = line;
new Thread(new Runnable() {
@Override
public void run() {
doProcessing(Sline);
}).start();
}
}
Sunny source
share