-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deadlock reported by #426 when FIFORunnable is disposed before running #428
Fix deadlock reported by #426 when FIFORunnable is disposed before running #428
Conversation
…osed before running
@bleeding182 Did you confirmed that this change indeed helps? |
@DariuszAniszewski Hey there! Yes, been debugging today, can't reproduce it with this fix. |
It's @dariuszseweryn ;) Great to hear that. I think that we should add a test for The test should be straightforward to write and just verify that the P.S. Maybe it would be a bit clearer if the code be something like:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One grammar suggestion.
@@ -35,44 +35,46 @@ public int compareTo(@NonNull FIFORunnableEntry other) { | |||
} | |||
|
|||
public void run(QueueSemaphore semaphore, Scheduler subscribeScheduler) { | |||
|
|||
if (operationResultObserver.isDisposed()) { | |||
RxBleLog.d("Operation was about to be run but the observer was already disposed: " + operation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about?
The operation was about to be run but the observer had been already disposed
As reported we should release the semaphore when we don't execute the operation.
Fixes #426