#vulnerable code 
                                public void destroySocket(Socket s)
    {
        if (s == null) {
            return;
        }

        if (sockets.remove(s)) {
            s.setLinger(linger);
            s.close();
        }
    } 
                            #location 8 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void destroySocket(Socket s)
    {
        if (s == null) {
            return;
        }
        s.setLinger(linger);
        s.close();
        try {
            mutex.lock();
            this.sockets.remove(s);
        }
        finally {
            mutex.unlock();
        }
    }