private static void removeTimer(SystemTimer timerToRemove) {
    synchronized (distributedSystemTimers) {
      // Get the timers for the distributed system
      Set<WeakReference<SystemTimer>> timers =
          distributedSystemTimers.get(timerToRemove.distributedSystem);
      if (timers == null) {
        return; // already gone
      }

      synchronized (timers) {
        Iterator<WeakReference<SystemTimer>> timersIterator = timers.iterator();
        while (timersIterator.hasNext()) {
          WeakReference<SystemTimer> ref = timersIterator.next();
          SystemTimer timer = ref.get();
          if (timer == null) {
            timersIterator.remove();
          } else if (timer == timerToRemove) {
            timersIterator.remove();
            break;
          } else if (timer.isCancelled()) {
            timersIterator.remove();
          }
        }
        if (timers.size() == 0) {
          distributedSystemTimers.remove(timerToRemove.distributedSystem); // last reference
        }
      }
    }

    sweepAllTimers(); // Occasionally check global list
  }
Remove given timer.

@param timerToRemove timer to remove

@see #cancel()
geode-core/src/main/java/org/apache/geode/internal/SystemTimer.java