4 Matching Annotations
  1. Jun 2023
    1. ```js FastMutex.prototype.runInLock = function (callback, opt_context) { this._setX()

      if (!this._isLockAvailable()) { this._retry(callback, opt_context) return }

      this._setY()

      if (this._getX() != this._clientId) { window.setTimeout(function () { if (this.hasLock()) this._execute(callback, opt_context) else this._retry(callback, opt_context) }.bind(this), Math.round(Math.random() * 100))

      } else { this._execute(callback, opt_context) } }

      FastMutex.prototype._execute = function (callback, opt_context) { var rv try { rv = callback.call(opt_context) } finally { if (rv instanceof goog.async.Deferred) { rv.addFinally(this._clearLock, this) } else { this._clearLock() } } } ```

  2. May 2023