From 4895c59b1f762433813dde06d8d2e4e306177486 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Sat, 15 Aug 2020 09:01:42 -0700 Subject: [PATCH] s/lck/syncObject/g (#1084) --- .../PrometheusExporterMetricsHttpServer.cs | 6 +++--- .../ZPagesExporterStatsHttpServer.cs | 6 +++--- src/OpenTelemetry/Metrics/MeterProviderSdk.cs | 4 ++-- src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Prometheus/PrometheusExporterMetricsHttpServer.cs b/src/OpenTelemetry.Exporter.Prometheus/PrometheusExporterMetricsHttpServer.cs index 46ee9183ef1..3be81d0ca8b 100644 --- a/src/OpenTelemetry.Exporter.Prometheus/PrometheusExporterMetricsHttpServer.cs +++ b/src/OpenTelemetry.Exporter.Prometheus/PrometheusExporterMetricsHttpServer.cs @@ -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; @@ -51,7 +51,7 @@ public PrometheusExporterMetricsHttpServer(PrometheusExporter exporter) /// An optional that can be used to stop the htto server. public void Start(CancellationToken token = default) { - lock (this.lck) + lock (this.syncObject) { if (this.tokenSource != null) { @@ -72,7 +72,7 @@ public void Start(CancellationToken token = default) /// public void Stop() { - lock (this.lck) + lock (this.syncObject) { if (this.tokenSource == null) { diff --git a/src/OpenTelemetry.Exporter.ZPages/ZPagesExporterStatsHttpServer.cs b/src/OpenTelemetry.Exporter.ZPages/ZPagesExporterStatsHttpServer.cs index 056ef1a959f..8872386e87a 100644 --- a/src/OpenTelemetry.Exporter.ZPages/ZPagesExporterStatsHttpServer.cs +++ b/src/OpenTelemetry.Exporter.ZPages/ZPagesExporterStatsHttpServer.cs @@ -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; @@ -53,7 +53,7 @@ public ZPagesExporterStatsHttpServer(ZPagesExporter exporter) /// An optional that can be used to stop the http server. public void Start(CancellationToken token = default) { - lock (this.lck) + lock (this.syncObject) { if (this.tokenSource != null) { @@ -74,7 +74,7 @@ public void Start(CancellationToken token = default) /// public void Stop() { - lock (this.lck) + lock (this.syncObject) { if (this.tokenSource == null) { diff --git a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs index de875b67ef3..e6bc95436d3 100644 --- a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs +++ b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs @@ -27,7 +27,7 @@ internal class MeterProviderSdk : MeterProvider public CancellationTokenSource CancellationTokenSource; public Dictionary MeterRegistry; - private readonly object lck = new object(); + private readonly object syncObject = new object(); private MeterSdk defaultMeter; internal MeterProviderSdk(MetricProcessor metricProcessor, Dictionary registry, PushMetricController controller, CancellationTokenSource cts) @@ -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)) diff --git a/src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs b/src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs index 2eb536ed654..d25acadb8ec 100644 --- a/src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs +++ b/src/OpenTelemetry/Trace/SimpleExportActivityProcessor.cs @@ -27,7 +27,7 @@ namespace OpenTelemetry.Trace /// public class SimpleExportActivityProcessor : ReentrantExportActivityProcessor { - private readonly object lck = new object(); + private readonly object syncObject = new object(); /// /// Initializes a new instance of the class. @@ -41,7 +41,7 @@ public SimpleExportActivityProcessor(ActivityExporterSync exporter) /// public override void OnEnd(Activity activity) { - lock (this.lck) + lock (this.syncObject) { base.OnEnd(activity); }