Suppose you have two threads that have access to the same public object. One thread has a block of code that reads the object's fields.
synchronized(object)
{
read object fields
}
While the read object field code is executing in thread 1, if thread 2 wants to update the object's fields, will it have to wait until thread 1 finishes reading the object's fields before updating (e.g. is the object locked from access by other threads while the synchronized code block is executing)?