Skip to content

Commit

Permalink
Avoids trying to schedule leave timeout twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho authored and bgrozev committed Aug 29, 2018
1 parent a561859 commit a5df3a2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/org/jitsi/jigasi/JvbConference.java
Original file line number Diff line number Diff line change
Expand Up @@ -1332,14 +1332,22 @@ class JvbConferenceStopTimeout
this.errorLog = errorLog;
}

/**
* Schedules a new timeout thread if not already scheduled.
*
* @param timeout the milliseconds to wait before we stop the conference
* if not canceled.
*/
void scheduleTimeout(long timeout)
{
synchronized (syncRoot)
{
this.timeout = timeout;

if (timeoutThread != null)
throw new IllegalStateException("already scheduled");
{
return;
}

this.timeout = timeout;

timeoutThread = new Thread(this, name);
willCauseTimeout = true;
Expand Down

0 comments on commit a5df3a2

Please sign in to comment.