Skip to content
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

Operation queue deadlock condition #2

Open
sgraesser17 opened this issue Apr 8, 2021 · 1 comment
Open

Operation queue deadlock condition #2

sgraesser17 opened this issue Apr 8, 2021 · 1 comment

Comments

@sgraesser17
Copy link

The operation queue will deadlock if cancelAllOperations is called on the queue before all operations have executed. The culprit is in the start method

guard !isCancelled else { finish() return }

The state value will be .ready which will cause the finish method to never change the state to .finished. Thus, causing a deadlock.

You can either update the guard statement to manually set the state to .finish.
Or, change the finish method to not check for the isExecuting state.

@wibosco
Copy link
Owner

wibosco commented Apr 9, 2021

@sgraesser17 thanks for pointing it out, I'll have a think about it and update the project to avoid this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants