Skip to content

Commit

Permalink
s/lck/syncObject/g (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Aug 15, 2020
1 parent 20bf5c9 commit 4895c59
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
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

0 comments on commit 4895c59

Please sign in to comment.