public override int GetHashCode() { int hash = 1; if (DebuggeeId.Length != 0) { hash ^= DebuggeeId.GetHashCode(); } if (WaitToken.Length != 0) { hash ^= WaitToken.GetHashCode(); } if (SuccessOnTimeout != false) { hash ^= SuccessOnTimeout.GetHashCode(); } return(hash); }
/// <summary> /// Frees the given token /// </summary> /// <param name="token">The token.</param> public void FreeToken(WaitToken token) { WaitToken t; bool r = tokens.TryRemove(token.Id, out t); }
/// <summary> /// Allocates a new wait token /// </summary> /// <returns></returns> public WaitToken AllocateToken() { var token = new WaitToken(Interlocked.Increment(ref nextId)); return(tokens.AddOrUpdate(token.Id, token, (a, b) => { throw new Exception("Key should not already be present"); })); }
/// <summary> /// Allocates a new wait token /// </summary> /// <returns></returns> public WaitToken AllocateToken() { var token = new WaitToken(Interlocked.Increment(ref nextId)); return tokens.AddOrUpdate(token.Id, token, (a, b) => { throw new Exception("Key should not already be present"); }); }