Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for compareAndSet (0.07 sec)

  1. guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

        for (int i = 0; i < 10; i++) {
          final int expectedCount = i;
          list.add(
              new Runnable() {
                @Override
                public void run() {
                  integer.compareAndSet(expectedCount, expectedCount + 1);
                }
              },
              directExecutor());
        }
        list.execute();
        assertEquals(10, integer.get());
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  2. src/main/java/jcifs/smb/SmbSessionImpl.java

                log.trace("Acquire session " + usage + " " + this);
            }
    
            if ( usage == 1 ) {
                synchronized ( this ) {
                    if ( this.transportAcquired.compareAndSet(false, true) ) {
                        log.debug("Reacquire transport");
                        this.transport.acquire();
                    }
                }
            }
    
            return this;
        }
    
    
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Sun Nov 14 17:41:04 UTC 2021
    - 49K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

        for (int i = 0; i < 10; i++) {
          final int expectedCount = i;
          list.add(
              new Runnable() {
                @Override
                public void run() {
                  integer.compareAndSet(expectedCount, expectedCount + 1);
                }
              },
              directExecutor());
        }
        list.execute();
        assertEquals(10, integer.get());
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

        check(executed.compareAndSet(false, true)) { "Already Executed" }
    
        timeout.enter()
        callStart()
        try {
          client.dispatcher.executed(this)
          return getResponseWithInterceptorChain()
        } finally {
          client.dispatcher.finished(this)
        }
      }
    
      override fun enqueue(responseCallback: Callback) {
        check(executed.compareAndSet(false, true)) { "Already Executed" }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 20 17:03:43 UTC 2024
    - 17.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/JdkFutureAdapters.java

          executionList.add(listener, exec);
    
          // When a listener is first added, we run a task that will wait for the delegate to finish,
          // and when it is done will run the listeners.
          if (hasListeners.compareAndSet(false, true)) {
            if (delegate.isDone()) {
              // If the delegate is already done, run the execution list immediately on the current
              // thread.
              executionList.execute();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Dec 14 20:35:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/SmbTreeImpl.java

                }
            }
    
            if ( usage == 1 ) {
                synchronized ( this ) {
                    if ( this.sessionAcquired.compareAndSet(false, true) ) {
                        log.debug("Reacquire session");
                        this.session.acquire();
                    }
                }
            }
            return this;
        }
    
    
        /**
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Thu Jan 05 13:06:39 UTC 2023
    - 29.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/JdkFutureAdapters.java

          executionList.add(listener, exec);
    
          // When a listener is first added, we run a task that will wait for the delegate to finish,
          // and when it is done will run the listeners.
          if (hasListeners.compareAndSet(false, true)) {
            if (delegate.isDone()) {
              // If the delegate is already done, run the execution list immediately on the current
              // thread.
              executionList.execute();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Dec 14 20:35:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  8. guava/src/com/google/common/util/concurrent/ExecutionSequencer.java

            executingTaskQueue.thread = null;
          }
        }
    
        private boolean trySetStarted() {
          return compareAndSet(NOT_RUN, STARTED);
        }
    
        private boolean trySetCancelled() {
          return compareAndSet(NOT_RUN, CANCELLED);
        }
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 01 21:46:34 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

      }
    
      /**
       * Simulate some of the races that can happen on add. We can't easily simulate the race that
       * happens when an {@link AtomicInteger#compareAndSet} fails, but we can simulate the case where
       * the putIfAbsent returns a non-null value, and the case where the replace() of an observed zero
       * fails.
       */
      public void testAdd_withFailures() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 14.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java

            executingTaskQueue.thread = null;
          }
        }
    
        private boolean trySetStarted() {
          return compareAndSet(NOT_RUN, STARTED);
        }
    
        private boolean trySetCancelled() {
          return compareAndSet(NOT_RUN, CANCELLED);
        }
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 01 21:46:34 UTC 2024
    - 22.1K bytes
    - Viewed (0)
Back to top