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

OneShotExecutorService Question #1

Open
glideken opened this issue Jul 4, 2015 · 1 comment
Open

OneShotExecutorService Question #1

glideken opened this issue Jul 4, 2015 · 1 comment

Comments

@glideken
Copy link

glideken commented Jul 4, 2015

Great lectures! This is not an issue but just a question that came to mind while reading OneShotExecutorService...

In OneShotExecutorService:processQueuedResults(), are having getQueue().take() in L196 and t.join() in L212 sufficient to ensure the tasks are finished than to also callCountDownLatch mExitBarrier.await() in L152? In other words, is the CountDownLatch necessary?

@AmazingDonut
Copy link

Valid point, OneShotExecutorService:processQueuedResults() will return once it processes all results from the queue which in turn will only have all results after all threads have completed.

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