concurrency issues.
548965
JSField getFieldDef(int accessor, boolean mustBePresent) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "getFieldDef", new Object[]{Integer.valueOf(accessor), Boolean.valueOf(mustBePresent)});

    if (mustBePresent) {
      if ((map == null) || (map.fields[accessor] == null)) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "getFieldDef", null);
        return null;
      }
    }

    JSField result = fields[accessor];
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "getFieldDef", result);
    return result;
  }
835724
private void lock() throws IOException {
		try {
			lock.lockInterruptibly();
		}
		catch (InterruptedException e) {
			Thread.currentThread().interrupt();
			throw new IOException("interrupted");
		}
	}
1224424
public static void mult(DMatrixRBlock A , DMatrixRBlock B , DMatrixRBlock C )
    {
        if( A.numCols != B.numRows )
            throw new IllegalArgumentException("Columns in A are incompatible with rows in B");
        if( A.numRows != C.numRows )
            throw new IllegalArgumentException("Rows in A are incompatible with rows in C");
        if( B.numCols != C.numCols )
            throw new IllegalArgumentException("Columns in B are incompatible with columns in C");
        if( A.blockLength != B.blockLength || A.blockLength != C.blockLength )
            throw new IllegalArgumentException("Block lengths are not all the same.");

        final int blockLength = A.blockLength;

        DSubmatrixD1 Asub = new DSubmatrixD1(A,0, A.numRows, 0, A.numCols);
        DSubmatrixD1 Bsub = new DSubmatrixD1(B,0, B.numRows, 0, B.numCols);
        DSubmatrixD1 Csub = new DSubmatrixD1(C,0, C.numRows, 0, C.numCols);

        MatrixMult_DDRB.mult(blockLength,Asub,Bsub,Csub);
    }
588459
@Override
    public boolean hasConcurrents() {
        if (concurrents > 0) {
            return true;
        }
        if (CommonUtils.isNotEmpty(methods)) {
            for (MethodConfig methodConfig : methods.values()) {
                if (methodConfig.getConcurrents() != null
                    && methodConfig.getConcurrents() > 0) {
                    return true;
                }
            }
        }
        return false;
    }
385265
public static void blockMultPlus( final double[] dataA, final double []dataB, final double []dataC,
                                     int indexA, int indexB, int indexC,
                                     final int heightA, final int widthA, final int widthC) {
//        for( int i = 0; i < heightA; i++ ) {
//            for( int k = 0; k < widthA; k++ ) {
//                for( int j = 0; j < widthC; j++ ) {
//                    dataC[ i*widthC + j + indexC ] += dataA[i*widthA + k + indexA] * dataB[k*widthC + j + indexB];
//                }
//            }
//        }

        int a = indexA;
        int rowC = indexC;
        for( int i = 0; i < heightA; i++ , rowC += widthC ) {
            int b = indexB;

            final int endC = rowC + widthC;
            final int endA = a + widthA;
            while( a != endA ) {//for( int k = 0; k < widthA; k++ ) {
                double valA = dataA[a++];

                int c = rowC;

                while( c != endC  ) {//for( int j = 0; j < widthC; j++ ) {
                    dataC[ c++ ] += valA * dataB[ b++ ];
                }
            }
        }
    }
595651
public void consistencyCheck() {
        for (int iRow = 0; iRow < 9; iRow++) {
            for (int iCol = 0; iCol < 9; iCol++) {
                Cell cell = cells[iRow][iCol];
                Integer value = cell.getValue();
                if (value != null) {
                    if (! cell.getFree().isEmpty()) {
                        throw new IllegalStateException("free not empty");
                    }
                    // any containing group
                    for (Cell other: cell.getExCells()) {
                        // must not occur in any of the other cells
                        if (value.equals(other.getValue())) {
                            throw new IllegalStateException("duplicate");
                        }
                        // must not occur in the permissibles of any of the other cells
                        if (other.getFree().contains(value)) {
                            throw new IllegalStateException("not eliminated");
                        }
                    }
                }
            }
        }
        
        for (int i = 0; i < rows.length; i++) {
            Set<Integer> aSet = new HashSet<Integer>();
            for (int j = 0; j < rows[i].getCells().size(); j++) {
                Cell cell = rows[i].getCells().get(j);
                Integer value = cell.getValue();
                if (value != null) {
                    aSet.add(value);
                } else {
                    aSet.addAll(cell.getFree());
                }
            }
            if (! aSet.equals(CellGroup.ALL_NINE)) {
                throw new IllegalStateException("deficit in row");
            }
        }
        
        for (int i = 0; i < cols.length; i++) {
            Set<Integer> aSet = new HashSet<Integer>();
            for (int j = 0; j < cols[i].getCells().size(); j++) {
                Cell cell = cols[i].getCells().get(j);
                Integer value = cell.getValue();
                if (value != null) {
                    aSet.add(value);
                } else {
                    aSet.addAll(cell.getFree());
                }
            }
            if (! aSet.equals(CellGroup.ALL_NINE)) {
                throw new IllegalStateException("deficit in column");
            }
        }

        for (int ir = 0; ir < sqrs.length; ir++) {
            for (int ic = 0; ic < sqrs[ir] .length; ic++) {
                Set<Integer> aSet = new HashSet<Integer>();
                for (int j = 0; j < sqrs[ir][ic].getCells().size(); j++) {
                    Cell cell = sqrs[ir][ic].getCells().get(j);
                    Integer value = cell.getValue();
                    if (value != null) {
                        aSet.add(value);
                    } else {
                        aSet.addAll(cell.getFree());
                    }
                }
                if (! aSet.equals(CellGroup.ALL_NINE)) {
                    throw new IllegalStateException("deficit in square");
                }
            }
        }
        System.out.println("+++ check OK +++");
    }
422575
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            if ((seen != Const.INVOKEVIRTUAL) || !"wait".equals(getNameConstantOperand()) || stack.getStackDepth() == 0) {
                return;
            }
            JavaClass cls = stack.getStackItem(0).getJavaClass();
            if (cls != null) {
                String clsName = cls.getClassName();
                if (concurrentAwaitClasses.contains(clsName)) {
                    bugReporter.reportBug(new BugInstance(this, BugType.SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT.name(), NORMAL_PRIORITY).addClass(this)
                            .addMethod(this).addSourceLine(this));
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
266147
private void repin() {
		if (logger.isLoggable(Level.WARNING))
			logger.warning("Tx." + txNum + " is re-pinning all buffers");
		
		try {
			// Copy the set of pinned buffers to avoid ConcurrentModificationException
			List<BlockId> blksToBeRepinned = new LinkedList<BlockId>();
			Map<BlockId, Integer> pinCounts = new HashMap<BlockId, Integer>();
			List<Buffer> buffersToBeUnpinned = new LinkedList<Buffer>();
			
			// Record the buffers to be un-pinned and the blocks to be re-pinned
			for (Entry<BlockId, PinnedBuffer> entry : pinnedBuffers.entrySet()) {
				blksToBeRepinned.add(entry.getKey());
				pinCounts.put(entry.getKey(), entry.getValue().pinnedCount);
				buffersToBeUnpinned.add(entry.getValue().buffer);
			}
			
			// Un-pin all buffers it has
			for (Buffer buf : buffersToBeUnpinned)
				unpin(buf);

			// Wait other threads pinning blocks
			synchronized (bufferPool) {
				bufferPool.wait(MAX_TIME);
			}

			// Re-pin all blocks
			for (BlockId blk : blksToBeRepinned)
				pin(blk);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
853039
public void poll() {
        synchronized (queue) {
            // Remove queued references.
            // (Is this better inside or out?)
            if (queue.poll() == null) {
                // Nothing to do.
                return;
            }
            while (queue.poll() != null) {
                // Discard.
            }

            // Remove any dead holders.
            Holder first = strongRefs;
            if (first == null) {
                // Unlikely...
                return;
            }
            Holder link = first;
            Holder next = link.next;
            while (next != null) {
                if (next.get() == null) {
                    next = next.next;
                    link.next = next;
                } else {
                    link = next;
                    next = next.next;
                }
            }

            // Remove dead head, possibly.
            if (first.get() == null) {
                if (!strongRefsUpdater.weakCompareAndSet(this, first, first.next)) {
                    // Something else has come along.
                    // Just null out - next search will remove it.
                    first.value = null;
                }
            }
        }
    }
262773
public void commitAndIndexIssues(DbSession dbSession, Collection<IssueDto> issues) {
    ListMultimap<String, EsQueueDto> itemsByIssueKey = ArrayListMultimap.create();
    issues.stream()
      .map(issue -> createQueueDto(issue.getKey(), ID_TYPE_ISSUE_KEY, issue.getProjectUuid()))
      // a mutable ListMultimap is needed for doIndexIssueItems, so MoreCollectors.index() is
      // not used
      .forEach(i -> itemsByIssueKey.put(i.getDocId(), i));
    dbClient.esQueueDao().insert(dbSession, itemsByIssueKey.values());

    dbSession.commit();

    doIndexIssueItems(dbSession, itemsByIssueKey);
  }
603195
void updateNeededReplications(BlockInfo blockInfo,
                                int curReplicasDelta, 
                                int expectedReplicasDelta) {
    writeLock();
    try {
      NumberReplicas repl = countNodes(blockInfo);
      int curExpectedReplicas = getReplication(blockInfo);
      neededReplications.update(blockInfo,
        repl.liveReplicas(),
        repl.decommissionedReplicas(),
        curExpectedReplicas,
        curReplicasDelta, expectedReplicasDelta);
    } finally {
      writeUnlock();
    }
  }
1310330
public void stable(long seqno) {
        lock.lock();
        try {
            if(seqno <= low)
                return;
            if(seqno > hd)
                throw new IllegalArgumentException("seqno " + seqno + " cannot be bigger than hd (" + hd + ")");

            int from=index(low+1), length=(int)(seqno - low), capacity=capacity();
            for(int i=from; i < from+length; i++) {
                int index=i & (capacity - 1);
                buf[index]=null;
            }

            // Releases some of the blocked adders
            if(seqno > low) {
                low=seqno;
                buffer_full.signalAll();
            }
        }
        finally {
            lock.unlock();
        }
    }
39850
protected void inconsistent(K key, StoreAccessException because, StoreAccessException... cleanup) {
    pacedErrorLog("Ehcache key {} in possible inconsistent state", key, because);
  }
1170752
def stop(self, exc=None, exit_code=None):
        '''
        '''
        return self._concurrency.stop(self, exc, exit_code)
1311797
private void doAcquireSharedInterruptibly(int arg)
        throws InterruptedException {
        final Node node = addWaiter(Node.SHARED);
        try {
            for (;;) {
                final Node p = node.predecessor();
                if (p == head) {
                    int r = tryAcquireShared(arg);
                    if (r >= 0) {
                        setHeadAndPropagate(node, r);
                        p.next = null; // help GC
                        return;
                    }
                }
                if (shouldParkAfterFailedAcquire(p, node) &&
                    parkAndCheckInterrupt())
                    throw new InterruptedException();
            }
        } catch (Throwable t) {
            cancelAcquire(node);
            throw t;
        }
    }
881212
public function deduplicate()
	{
		if ($this->useCount > 1)
		{
			$this->isDeduplicated = true;
			$this->decrementUseCount($this->useCount - 1);
		}
	}
908331
def get_concurrency(self):
        """"""
        method = 'GET'
        endpoint = '/rest/v1.1/users/{}/concurrency'.format(
            self.client.sauce_username)
        return self.client.request(method, endpoint)