#vulnerable code 
                                @Override
    public void receive(DatagramPacket p)
        throws IOException
    {
        synchronized (inReceiveSyncRoot)
        {
            inReceive++;
        }
        try
        {
            super.receive(p);
        }
        finally
        {
            synchronized (inReceiveSyncRoot)
            {
                inReceive--;
                inReceiveSyncRoot.notifyAll();
            }
        }
    } 
                            #location 11 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                @Override
    public void receive(DatagramPacket p)
        throws IOException
    {
        final Lock receiveLock = receiveCloseLock.readLock();
        receiveLock.lock();
        try
        {
            super.receive(p);
        }
        finally
        {
            receiveLock.unlock();
        }
    }