Skip to content

Commit

Permalink
Possible deadlock in WebcamGrabberProcessor
Browse files Browse the repository at this point in the history
fixes #8
  • Loading branch information
sarxos committed Dec 26, 2012
1 parent 6b97f75 commit 0320c80
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -63,7 +63,8 @@ public void run() {

/**
* Internal task used to create new grabber. Yeah, native grabber
* construction also has to be super-synchronized.
* construction, same as all other methods invoked on its instance, also has
* to be super-synchronized.
*
* @author Bartosz Firyn (SarXos)
*/
Expand Down Expand Up @@ -128,9 +129,9 @@ protected void process(WebcamGrabberTask task) {
synchronized (this) {
if (grabber == null) {
NewGrabberTask grabberTask = new NewGrabberTask();
tasks.offer(grabberTask);
try {
synchronized (grabberTask) {
tasks.offer(grabberTask);
grabberTask.wait();
grabber = grabberTask.getGrabber();
}
Expand Down

0 comments on commit 0320c80

Please sign in to comment.