Switch from events to locks during parsing (#87)

* Switch from event to locks in binding.

* Remove unneeded null check.
This commit is contained in:
Karl Burtram
2016-10-12 15:09:24 -07:00
committed by GitHub
parent 9f39ac6014
commit c5f44ccee1
9 changed files with 87 additions and 85 deletions

View File

@@ -4,7 +4,6 @@
//
using System;
using System.Threading;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.SmoMetadataProvider;
using Microsoft.SqlServer.Management.SqlParser.Binder;
@@ -21,6 +20,8 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
{
private ParseOptions parseOptions;
private object bindingLock;
private ServerConnection serverConnection;
/// <summary>
@@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
/// </summary>
public ConnectedBindingContext()
{
this.BindingLocked = new ManualResetEvent(initialState: true);
this.bindingLock = new object();
this.BindingTimeout = ConnectedBindingQueue.DefaultBindingTimeout;
this.MetadataDisplayInfoProvider = new MetadataDisplayInfoProvider();
}
@@ -72,9 +73,15 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
public IBinder Binder { get; set; }
/// <summary>
/// Gets or sets an event to signal if a binding operation is in progress
/// Gets the binding lock object
/// </summary>
public ManualResetEvent BindingLocked { get; set; }
public object BindingLock
{
get
{
return this.bindingLock;
}
}
/// <summary>
/// Gets or sets the binding operation timeout in milliseconds