Closed fifteenhex closed 6 years ago
getting the same error here
Seeing the same here - with a poor connection, SntpClient.requestTime locks SntpClient which causes calls to wasInitialized() from UI thread to block for a very long time
apologies for replying so late. I actually have had a branch kg/fix/sync_to_atomic for sometime that should address this.
PR #80 should address this.
Alternatively, you can try importing that branch directly and seeing if it addresses your issue.
master
should have the required fixes now. If you're eager to take this before it hits 3.4
try:
implementation com.github.instacart.truetime-android:library-extension-rx:09087b6a6e
closing this out as I'm hoping the newer version of this lib has resolved this issue
Updating to 3.4 fixed the issue for me.
If the library is initialized asynchronously like with initializeRx() a deadlock happens if you try to get the time before initialization has completed because the initialization process and the check for initialization want to lock the SntpClient instance.
Maybe change the initialized flag to an AtomicBoolean so it has it's own locking?