Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/lck/syncObject/g #1084

Merged
merged 1 commit into from
Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class PrometheusExporterMetricsHttpServer : IDisposable
{
private readonly PrometheusExporter exporter;
private readonly HttpListener httpListener = new HttpListener();
private readonly object lck = new object();
private readonly object syncObject = new object();

private CancellationTokenSource tokenSource;
private Task workerThread;
Expand All @@ -51,7 +51,7 @@ public PrometheusExporterMetricsHttpServer(PrometheusExporter exporter)
/// <param name="token">An optional <see cref="CancellationToken"/> that can be used to stop the htto server.</param>
public void Start(CancellationToken token = default)
{
lock (this.lck)
lock (this.syncObject)
{
if (this.tokenSource != null)
{
Expand All @@ -72,7 +72,7 @@ public void Start(CancellationToken token = default)
/// </summary>
public void Stop()
{
lock (this.lck)
lock (this.syncObject)
{
if (this.tokenSource == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace OpenTelemetry.Exporter.ZPages
public class ZPagesExporterStatsHttpServer : IDisposable
{
private readonly HttpListener httpListener = new HttpListener();
private readonly object lck = new object();
private readonly object syncObject = new object();

private CancellationTokenSource tokenSource;
private Task workerThread;
Expand All @@ -53,7 +53,7 @@ public ZPagesExporterStatsHttpServer(ZPagesExporter exporter)
/// <param name="token">An optional <see cref="CancellationToken"/> that can be used to stop the http server.</param>
public void Start(CancellationToken token = default)
{
lock (this.lck)
lock (this.syncObject)
{
if (this.tokenSource != null)
{
Expand All @@ -74,7 +74,7 @@ public void Start(CancellationToken token = default)
/// </summary>
public void Stop()
{
lock (this.lck)
lock (this.syncObject)
{
if (this.tokenSource == null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTelemetry/Metrics/MeterProviderSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class MeterProviderSdk : MeterProvider
public CancellationTokenSource CancellationTokenSource;
public Dictionary<MeterRegistryKey, MeterSdk> MeterRegistry;

private readonly object lck = new object();
private readonly object syncObject = new object();
private MeterSdk defaultMeter;

internal MeterProviderSdk(MetricProcessor metricProcessor, Dictionary<MeterRegistryKey, MeterSdk> registry, PushMetricController controller, CancellationTokenSource cts)
Expand All @@ -47,7 +47,7 @@ public override Meter GetMeter(string name, string version = null)
return this.defaultMeter;
}

lock (this.lck)
lock (this.syncObject)
{
var key = new MeterRegistryKey(name, version);
if (!this.MeterRegistry.TryGetValue(key, out var meter))
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace OpenTelemetry.Trace
/// </summary>
public class SimpleExportActivityProcessor : ReentrantExportActivityProcessor
{
private readonly object lck = new object();
private readonly object syncObject = new object();

/// <summary>
/// Initializes a new instance of the <see cref="SimpleExportActivityProcessor"/> class.
Expand All @@ -41,7 +41,7 @@ public SimpleExportActivityProcessor(ActivityExporterSync exporter)
/// <inheritdoc />
public override void OnEnd(Activity activity)
{
lock (this.lck)
lock (this.syncObject)
{
base.OnEnd(activity);
}
Expand Down