synchronized (mSelectorGuard) { }
    private void serverLoop() {        while (true) {            synchronized (this) {                if (mShutdownRequested) {                    break;                }            }            int readyCount = 0;            try {                if (mLog.isDebugEnabled()) mLog.debug("entering select");                readyCount = mSelector.select();            } catch (IOException ioe) {                mLog.warn("OzServer IOException in select", ioe);            }            if (mLog.isDebugEnabled()) mLog.debug("selected " + readyCount);            if (readyCount == 0) {                continue;            }            Iterator<SelectionKey> iter = mSelector.selectedKeys().iterator();            while (iter.hasNext()) {                SelectionKey readyKey = iter.next();                iter.remove();                OzConnection readyConnection = null;                 try {                    if (readyKey.attachment() != null && readyKey.attachment() instanceof OzConnection) {                        readyConnection = (OzConnection)readyKey.attachment();                        readyConnection.addToNDC();                    }                                        if (!readyKey.isValid()) {                        continue;                    }                    synchronized (readyKey) {                        OzUtil.logKey(mLog, readyKey, "ready key");                    }                                        if (readyKey.isAcceptable()) {                        Socket newSocket = mServerSocket.accept();                        SocketChannel newChannel = newSocket.getChannel();                         newChannel.configureBlocking(false);                        readyConnection= new OzConnection(OzServer.this, newChannel);                    }                                        if (readyKey.isReadable()) {                        readyConnection.doReadReady();                    }                                        if (readyKey.isWritable()) {                        readyConnection.doWriteReady();                    }                } catch (Throwable t) {                    mLog.warn("ignoring exception that occurred while handling selected key", t);                    if (readyConnection != null) {                        readyConnection.channelClose();                    }                } finally {                    if (readyConnection != null) {                        readyConnection.clearFromNDC();                    }                }                            } /* end of ready keys loop */            if (mLog.isDebugEnabled()) mLog.debug("processed " + readyCount + " ready keys");        }                assert(mShutdownRequested);        mLog.info("shutting down thread pool");        mPooledExecutor.shutdownNow();        try {            mLog.info("waiting for thread pool to shutdown");            mPooledExecutor.awaitTerminationAfterShutdown(10*1000);        } catch (InterruptedException ie) {            mLog.warn("unexpected exception when waiting for shutdown");        }        mLog.info("done waiting for thread pool to shutdown");        mLog.info("closing all selection keys");        Set keys = mSelector.keys();        for (Iterator iter = keys.iterator(); iter.hasNext();) {            SelectionKey key = (SelectionKey) iter.next();            try {                key.channel().close();            } catch (IOException ioe) {                mLog.info("exception closing selection key", ioe);            }        }        try {            mSelector.close();        } catch (IOException ioe) {            mLog.warn("unexpected exception when closing selector");        }        mLog.info("closed selector");        mLog.info("initiating buffer pool destroy");        synchronized (mShutdownCompleteCondition) {            mShutdownComplete = true;            mShutdownCompleteCondition.notify();        }    }