-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5788 from NuGet/dev
[ReleasePrep][2018.04.05]RI of dev into master
- Loading branch information
Showing
143 changed files
with
7,189 additions
and
1,432 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
} | ||
|
||
.subtitle { | ||
margin-top: 24px; | ||
margin-top: 33px; | ||
} | ||
|
||
.form-section-title { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/NuGet.Services.Search.Client/Client/ThreadSafeRandom.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace NuGet.Services.Search.Client | ||
{ | ||
/// <summary> | ||
/// A thread safe random implementation | ||
/// https://blogs.msdn.microsoft.com/pfxteam/2009/02/19/getting-random-numbers-in-a-thread-safe-way/ | ||
/// </summary> | ||
public static class ThreadSafeRandom | ||
{ | ||
private static Random _global = new Random(); | ||
|
||
[ThreadStatic] | ||
private static Random _local; | ||
|
||
public static int Next() | ||
{ | ||
Random inst = GetLocalInstance(); | ||
return inst.Next(); | ||
} | ||
|
||
public static int Next(int min, int max) | ||
{ | ||
Random inst = GetLocalInstance(); | ||
return inst.Next(min, max); | ||
} | ||
|
||
static Random GetLocalInstance() | ||
{ | ||
Random inst = _local; | ||
if (inst == null) | ||
{ | ||
int seed; | ||
lock (_global) | ||
{ | ||
seed = _global.Next(); | ||
} | ||
_local = inst = new Random(seed); | ||
} | ||
return inst; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.