T
TimTT
Gast
Hallo,
der Titel sagt schon alles. Ich frage mich ob dieser Codeabschnitt sicher gegen concurrent modification ist? Also ist das Lock immernoch auf der Liste, wenn ein Thread die Liste mit der get-Methode geholt hat?
public List<XYZ> xyzList = null;
public List<XYZ> getXYZList()
{
synchronized(xyzList){
return xyzList;
}
}
der Titel sagt schon alles. Ich frage mich ob dieser Codeabschnitt sicher gegen concurrent modification ist? Also ist das Lock immernoch auf der Liste, wenn ein Thread die Liste mit der get-Methode geholt hat?
public List<XYZ> xyzList = null;
public List<XYZ> getXYZList()
{
synchronized(xyzList){
return xyzList;
}
}