with code such as
synchronized (this)
{
mTimeOutRunnable = new Runnable()
{
@Override
public void run()
{
..some code
}
};
}
the reference assignement of the new Runnable class is covered by the block but will code inside run() (which is asyncronously called outside of the block) enter into the synchronized block also?
I wrapped in the sync block in the first place as this is called from a worker thread and I want to ensure the calling (main) thread has access to the mTimeOutRunnable object also.
No, only the assignment of your
RunnabletomTimeOutRunnableis covered by thesynchronizedblock, not subsequent calls to therun()method.