public Foo getFoo(){
Foo foo = null;
synchronized(fooList){
if(fooList.size() > 0){
foo = fooList.remove(0);
}
}
return foo;
}
Since foo
is declared outside of the synchronized block, does the potential exist of returning bad data?