Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -41,26 +41,26 @@ namespace System.Transactions
this.options = options;
}
public IAsyncResult BeginCommit (AsyncCallback callback,
object user_defined_state)
public IAsyncResult BeginCommit (AsyncCallback asyncCallback,
object asyncState)
{
this.callback = callback;
this.user_defined_state = user_defined_state;
this.callback = asyncCallback;
this.user_defined_state = asyncState;
AsyncCallback cb = null;
if (callback != null)
if (asyncCallback != null)
cb = new AsyncCallback (CommitCallback);
asyncResult = BeginCommitInternal (cb);
return this;
}
public void EndCommit (IAsyncResult ar)
public void EndCommit (IAsyncResult asyncResult)
{
if (ar != this)
if (asyncResult != this)
throw new ArgumentException ("The IAsyncResult parameter must be the same parameter as returned by BeginCommit.", "asyncResult");
EndCommitInternal (asyncResult);
EndCommitInternal (this.asyncResult);
}
private void CommitCallback (IAsyncResult ar)

View File

@@ -19,11 +19,11 @@ namespace System.Transactions
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface IDtcTransaction
{
void Abort (IntPtr manager, int whatever, int whatever2);
void Abort (IntPtr reason, int retaining, int async);
void Commit (int whatever, int whatever2, int whatever3);
void Commit (int retaining, int commitType, int reserved);
void GetTransactionInfo (IntPtr whatever);
void GetTransactionInfo (IntPtr transactionInformation);
}
}

View File

@@ -14,9 +14,9 @@ namespace System.Transactions
{
void Initialize ();
void Rollback (SinglePhaseEnlistment enlistment);
void Rollback (SinglePhaseEnlistment singlePhaseEnlistment);
void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}

View File

@@ -13,7 +13,7 @@ namespace System.Transactions
public interface ISinglePhaseNotification
: IEnlistmentNotification
{
void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}

View File

@@ -40,9 +40,9 @@ namespace System.Transactions
}
[MonoTODO]
public void ForceRollback (Exception ex)
public void ForceRollback (Exception e)
{
tx.Rollback (ex, enlisted);
tx.Rollback (e, enlisted);
/* See test RMFail2 */
((ManualResetEvent) waitHandle).Set ();
}

View File

@@ -14,7 +14,7 @@ namespace System.Transactions
[Serializable]
public sealed class SubordinateTransaction : Transaction
{
public SubordinateTransaction (IsolationLevel level,
public SubordinateTransaction (IsolationLevel isoLevel,
ISimpleTransactionSuperior superior)
{
throw new NotImplementedException ();

View File

@@ -137,44 +137,44 @@ namespace System.Transactions
[MonoTODO]
public DependentTransaction DependentClone (
DependentCloneOption option)
DependentCloneOption cloneOption)
{
DependentTransaction d =
new DependentTransaction (this, option);
new DependentTransaction (this, cloneOption);
dependents.Add (d);
return d;
}
[MonoTODO ("Only SinglePhase commit supported for durable resource managers.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
public Enlistment EnlistDurable (Guid manager,
IEnlistmentNotification notification,
EnlistmentOptions options)
public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
IEnlistmentNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions)
{
throw new NotImplementedException ("DTC unsupported, only SinglePhase commit supported for durable resource managers.");
}
[MonoTODO ("Only Local Transaction Manager supported. Cannot have more than 1 durable resource per transaction. Only EnlistmentOptions.None supported yet.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
public Enlistment EnlistDurable (Guid manager,
ISinglePhaseNotification notification,
EnlistmentOptions options)
public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
ISinglePhaseNotification singlePhaseNotification,
EnlistmentOptions enlistmentOptions)
{
EnsureIncompleteCurrentScope ();
if (pspe != null || Durables.Count > 0)
throw new NotImplementedException ("DTC unsupported, multiple durable resource managers aren't supported.");
if (options != EnlistmentOptions.None)
if (enlistmentOptions != EnlistmentOptions.None)
throw new NotImplementedException ("EnlistmentOptions other than None aren't supported");
Durables.Add (notification);
Durables.Add (singlePhaseNotification);
/* FIXME: Enlistment ?? */
return new Enlistment ();
}
public bool EnlistPromotableSinglePhase (
IPromotableSinglePhaseNotification notification)
IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
{
EnsureIncompleteCurrentScope ();
@@ -183,7 +183,7 @@ namespace System.Transactions
if (pspe != null || Durables.Count > 0)
return false;
pspe = notification;
pspe = promotableSinglePhaseNotification;
pspe.Initialize();
return true;
@@ -211,19 +211,19 @@ namespace System.Transactions
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
IEnlistmentNotification notification,
EnlistmentOptions options)
IEnlistmentNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions)
{
return EnlistVolatileInternal (notification, options);
return EnlistVolatileInternal (enlistmentNotification, enlistmentOptions);
}
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
ISinglePhaseNotification notification,
EnlistmentOptions options)
ISinglePhaseNotification singlePhaseNotification,
EnlistmentOptions enlistmentOptions)
{
/* FIXME: Anything extra reqd for this? */
return EnlistVolatileInternal (notification, options);
return EnlistVolatileInternal (singlePhaseNotification, enlistmentOptions);
}
private Enlistment EnlistVolatileInternal (
@@ -287,10 +287,10 @@ namespace System.Transactions
Rollback (null);
}
public void Rollback (Exception ex)
public void Rollback (Exception e)
{
EnsureIncompleteCurrentScope ();
Rollback (ex, null);
Rollback (e, null);
}
internal void Rollback (Exception ex, object abortingEnlisted)

View File

@@ -25,27 +25,27 @@ namespace System.Transactions
[MonoTODO]
public static byte [] GetExportCookie (Transaction transaction,
byte [] exportCookie)
byte [] whereabouts)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromDtcTransaction (
IDtcTransaction dtc)
IDtcTransaction transactionNative)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromExportCookie (
byte [] exportCookie)
byte [] cookie)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] token)
public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] propagationToken)
{
throw new NotImplementedException ();
}

View File

@@ -67,15 +67,15 @@ namespace System.Transactions
}
[MonoTODO ("Not implemented")]
public static void RecoveryComplete (Guid manager)
public static void RecoveryComplete (Guid resourceManagerIdentifier)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
public static Enlistment Reenlist (Guid manager,
byte[] recoveryInfo,
IEnlistmentNotification notification)
public static Enlistment Reenlist (Guid resourceManagerIdentifier,
byte[] recoveryInformation,
IEnlistmentNotification enlistmentNotification)
{
throw new NotImplementedException ();
}

View File

@@ -32,18 +32,18 @@ namespace System.Transactions
set { timeout = value; }
}
public static bool operator == (TransactionOptions o1,
TransactionOptions o2)
public static bool operator == (TransactionOptions x,
TransactionOptions y)
{
return o1.level == o2.level &&
o1.timeout == o2.timeout;
return x.level == y.level &&
x.timeout == y.timeout;
}
public static bool operator != (TransactionOptions o1,
TransactionOptions o2)
public static bool operator != (TransactionOptions x,
TransactionOptions y)
{
return o1.level != o2.level ||
o1.timeout != o2.timeout;
return x.level != y.level ||
x.timeout != y.timeout;
}
public override bool Equals (object obj)

View File

@@ -39,39 +39,39 @@ namespace System.Transactions
{
}
public TransactionScope(TransactionScopeAsyncFlowOption asyncFlow)
public TransactionScope(TransactionScopeAsyncFlowOption asyncFlowOption)
: this(TransactionScopeOption.Required,
TransactionManager.DefaultTimeout, asyncFlow)
TransactionManager.DefaultTimeout, asyncFlowOption)
{
}
public TransactionScope (Transaction transaction)
: this (transaction, TransactionManager.DefaultTimeout)
public TransactionScope (Transaction transactionToUse)
: this (transactionToUse, TransactionManager.DefaultTimeout)
{
}
public TransactionScope (Transaction transaction,
TimeSpan timeout)
: this (transaction, timeout, DTCOption.None)
public TransactionScope (Transaction transactionToUse,
TimeSpan scopeTimeout)
: this (transactionToUse, scopeTimeout, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported.")]
public TransactionScope (Transaction transaction,
TimeSpan timeout, DTCOption opt)
public TransactionScope (Transaction transactionToUse,
TimeSpan scopeTimeout, DTCOption interopOption)
{
Initialize (TransactionScopeOption.Required,
transaction, defaultOptions, opt, timeout, TransactionScopeAsyncFlowOption.Suppress);
transactionToUse, defaultOptions, interopOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
public TransactionScope (TransactionScopeOption option)
: this (option, TransactionManager.DefaultTimeout)
public TransactionScope (TransactionScopeOption scopeOption)
: this (scopeOption, TransactionManager.DefaultTimeout)
{
}
public TransactionScope (TransactionScopeOption option,
TimeSpan timeout)
: this (option, timeout, TransactionScopeAsyncFlowOption.Suppress)
public TransactionScope (TransactionScopeOption scopeOption,
TimeSpan scopeTimeout)
: this (scopeOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress)
{
}
@@ -80,25 +80,25 @@ namespace System.Transactions
{
}
public TransactionScope (TransactionScopeOption option,
TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
public TransactionScope (TransactionScopeOption scopeOption,
TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
Initialize (option, null, defaultOptions,
DTCOption.None, timeout, asyncFlow);
Initialize (scopeOption, null, defaultOptions,
DTCOption.None, scopeTimeout, asyncFlow);
}
public TransactionScope (TransactionScopeOption scopeOption,
TransactionOptions options)
: this (scopeOption, options, DTCOption.None)
TransactionOptions transactionOptions)
: this (scopeOption, transactionOptions, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported")]
public TransactionScope (TransactionScopeOption scopeOption,
TransactionOptions options,
DTCOption opt)
TransactionOptions transactionOptions,
DTCOption interopOption)
{
Initialize (scopeOption, null, options, opt,
Initialize (scopeOption, null, transactionOptions, interopOption,
TransactionManager.DefaultTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
@@ -124,17 +124,17 @@ namespace System.Transactions
void Initialize (TransactionScopeOption scopeOption,
Transaction tx, TransactionOptions options,
DTCOption interop, TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
DTCOption interop, TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
completed = false;
isRoot = false;
nested = 0;
asyncFlowEnabled = asyncFlow == TransactionScopeAsyncFlowOption.Enabled;
if (timeout < TimeSpan.Zero)
throw new ArgumentOutOfRangeException ("timeout");
if (scopeTimeout < TimeSpan.Zero)
throw new ArgumentOutOfRangeException ("scopeTimeout");
this.timeout = timeout;
this.timeout = scopeTimeout;
oldTransaction = Transaction.CurrentInternal;

View File

@@ -25,14 +25,14 @@ namespace MonoTests.System.Transactions
TransactionScope scope = new TransactionScope (TransactionScopeOption.Required, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (ex.ParamName, "timeout");
Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
try {
TransactionScope scope = new TransactionScope (null, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (ex.ParamName, "timeout");
Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
}