| | |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyrighted 2026 3A Systems, LLC. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | */ |
| | | private final Object waitListen = new Object(); |
| | | |
| | | /** |
| | | * Condition predicate for {@link #waitListen}: set once the selector thread |
| | | * has attempted to open the listen channels (successfully or not). Guarded |
| | | * by the {@link #waitListen} monitor; protects the start method against |
| | | * spurious wakeups. |
| | | */ |
| | | private boolean listenAttempted; |
| | | |
| | | /** The friendly name of this connection handler. */ |
| | | private String friendlyName; |
| | | |
| | |
| | | |
| | | try |
| | | { |
| | | waitListen.wait(); |
| | | while (!listenAttempted) |
| | | { |
| | | waitListen.wait(); |
| | | } |
| | | } |
| | | catch (InterruptedException e) |
| | | { |
| | | // If something interrupted the start its probably better |
| | | // to return ASAP. |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | } |
| | |
| | | synchronized (waitListen) |
| | | { |
| | | starting = false; |
| | | listenAttempted = true; |
| | | waitListen.notify(); |
| | | } |
| | | } |
| | |
| | | // should be notified and resume its work in any cases. |
| | | synchronized (waitListen) |
| | | { |
| | | listenAttempted = true; |
| | | waitListen.notify(); |
| | | } |
| | | |