server/src/jetbrains/buildServer/sharedResources/server/runtime/TakenLocksImpl.java [200:222]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          @NotNull final DistributionDataAccessor distributionDataAccessor,
                                          @NotNull final BuildPromotion buildPromotion,
                                          @NotNull final Map<Resource, String> result) {
    // what type of lock do we have:
    // write            -> all
    // read with value  -> specific
    // read             -> any
    final TakenLock takenLock = getOrCreateTakenLock(takenLocks, resource);
    switch (lock.getType()) {
      case READ:   // check at least one value is available
        // check for unique writeLocks
        List<BuildPromotion> promosInFairSet = distributionDataAccessor.getFairSet().get(resource.getId());
        if (promosInFairSet != null && !promosInFairSet.isEmpty()) {
          String description = describeLockingPromotions(promosInFairSet);
          result.put(resource, "(write lock requested by " + description + ")");
          break;
        }
        // check for write locks
        if (takenLock.hasWriteLocks()) {
          // write lock can be in chain head, read locks can be in chain parts
          String description = describeLockingPromotions(takenLock.getReadLocks().keySet(), takenLock.getWriteLocks().keySet());
          result.put(resource, "(locked by " + description + ")");
          break;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



server/src/jetbrains/buildServer/sharedResources/server/runtime/TakenLocksImpl.java [267:284]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          @NotNull final DistributionDataAccessor distributionDataAccessor,
                                          @NotNull final BuildPromotion buildPromotion,
                                          @NotNull final Map<Resource, String> result) {
    final TakenLock takenLock = getOrCreateTakenLock(takenLocks, resource);
    switch (lock.getType()) {
      case READ:
        // some build requested write lock on the current resource before us
        List<BuildPromotion> promosInFairSet = distributionDataAccessor.getFairSet().get(resource.getId());
        if (promosInFairSet != null && !promosInFairSet.isEmpty()) {
          String description = describeLockingPromotions(promosInFairSet);
          result.put(resource, "(write lock requested by " + description + ")");
          break;
        }
        // Check that no WriteLocks exist
        if (takenLock.hasWriteLocks()) {
          String description = describeLockingPromotions(takenLock.getReadLocks().keySet(), takenLock.getWriteLocks().keySet());
          result.put(resource, "(locked by " + description + ")");
          break;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



