I have noticed what possibly could be an issue on STEP 7 of the code lab.
At the end of this step (as shown in the screen shot), the code to create the database checks nullness of Instance in non-synchronized manner and it is after that it enters to the synchronized block to initialize it. Does not this create a race condition and allow re-initialization of the database? OR is this an acceptable behaviour when it comes to ROOM?
URL of codelab
I have noticed what possibly could be an issue on STEP 7 of the code lab.
At the end of this step (as shown in the screen shot), the code to create the database checks nullness of
Instance
in non-synchronized manner and it is after that it enters to the synchronized block to initialize it. Does not this create a race condition and allow re-initialization of the database? OR is this an acceptable behaviour when it comes to ROOM?