Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / ExecutorLocksHeldException.cs / 1305376 / ExecutorLocksHeldException.cs
// **************************************************************************** // Copyright (C) 2000-2001 Microsoft Corporation. All rights reserved. // // CONTENTS // Workflow Base exception class // // DESCRIPTION // Base class for WINOE Runtime engine exception // // REVISIONS // Date Ver By Remarks // ~~~~~~~~~~ ~~~ ~~~~~~~~ ~~~~~~~~~~~~~~ // 03/08/01 1.0 [....] Created. // *************************************************************************** using System; using System.Runtime.Serialization; using System.Security.Permissions; using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Workflow; using System.Workflow.Runtime; using System.Workflow.ComponentModel; namespace System.Workflow.Runtime { /* * The Unload() method has been changed so that * any Unload requests made while in the middle of an atomic * transaction wait for the atomic transaction to complete. * This makes use of an ManualResetEvent. Unload() waits on the event: * theEvent.WaitOne() * But waiting with the executor and scheduler locks held * will block everything else. * * The solution is to have a custom internal exception class that has the * ManualResetEvent as an internal property. If Unload() finds itself in the middle * of an atomic transaction, it throws the Exception. The Exception is propogated upwards * until we reach the method that was the first to grab the executor lock. * * We then drop that lock and wait on the event handle. As soon as the handle is * Set() by DisposeTransaction(), we grab the executor lock and do everything all over. */ internal class ExecutorLocksHeldException : Exception { private ManualResetEvent handle; public ExecutorLocksHeldException(ManualResetEvent handle) { this.handle = handle; } internal ManualResetEvent Handle { get { return handle; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. // **************************************************************************** // Copyright (C) 2000-2001 Microsoft Corporation. All rights reserved. // // CONTENTS // Workflow Base exception class // // DESCRIPTION // Base class for WINOE Runtime engine exception // // REVISIONS // Date Ver By Remarks // ~~~~~~~~~~ ~~~ ~~~~~~~~ ~~~~~~~~~~~~~~ // 03/08/01 1.0 [....] Created. // *************************************************************************** using System; using System.Runtime.Serialization; using System.Security.Permissions; using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Workflow; using System.Workflow.Runtime; using System.Workflow.ComponentModel; namespace System.Workflow.Runtime { /* * The Unload() method has been changed so that * any Unload requests made while in the middle of an atomic * transaction wait for the atomic transaction to complete. * This makes use of an ManualResetEvent. Unload() waits on the event: * theEvent.WaitOne() * But waiting with the executor and scheduler locks held * will block everything else. * * The solution is to have a custom internal exception class that has the * ManualResetEvent as an internal property. If Unload() finds itself in the middle * of an atomic transaction, it throws the Exception. The Exception is propogated upwards * until we reach the method that was the first to grab the executor lock. * * We then drop that lock and wait on the event handle. As soon as the handle is * Set() by DisposeTransaction(), we grab the executor lock and do everything all over. */ internal class ExecutorLocksHeldException : Exception { private ManualResetEvent handle; public ExecutorLocksHeldException(ManualResetEvent handle) { this.handle = handle; } internal ManualResetEvent Handle { get { return handle; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompilerState.cs
- KerberosReceiverSecurityToken.cs
- ModifierKeysValueSerializer.cs
- PropertyFilterAttribute.cs
- ModelTypeConverter.cs
- RegistrationServices.cs
- RemoteEndpointMessageProperty.cs
- InternalConfigHost.cs
- ErrorInfoXmlDocument.cs
- Animatable.cs
- QueryExpr.cs
- FrameworkTemplate.cs
- PrintDialog.cs
- DbCommandTree.cs
- NameValueConfigurationCollection.cs
- ResXResourceReader.cs
- _Events.cs
- EdmProviderManifest.cs
- LocatorPart.cs
- FixedPageProcessor.cs
- Socket.cs
- PrinterUnitConvert.cs
- DataTrigger.cs
- ClientRolePrincipal.cs
- RawStylusSystemGestureInputReport.cs
- NameSpaceExtractor.cs
- SpeechAudioFormatInfo.cs
- BindToObject.cs
- TextSpanModifier.cs
- EmptyArray.cs
- PanelDesigner.cs
- Variant.cs
- AddInEnvironment.cs
- DataGridViewSelectedColumnCollection.cs
- ManageRequest.cs
- EUCJPEncoding.cs
- XPathDescendantIterator.cs
- TextBoxView.cs
- DataSourceView.cs
- XsltSettings.cs
- OdbcCommand.cs
- Literal.cs
- WebPartZoneAutoFormat.cs
- QuaternionAnimationBase.cs
- HttpGetProtocolImporter.cs
- AuthenticationModulesSection.cs
- DataGridCommandEventArgs.cs
- CompositeFontInfo.cs
- TypeConverterAttribute.cs
- SectionRecord.cs
- FormClosingEvent.cs
- SQLDateTime.cs
- ProcessHostMapPath.cs
- ContextMenu.cs
- CharacterMetrics.cs
- FontDriver.cs
- MenuItem.cs
- InfocardClientCredentials.cs
- ApplicationHost.cs
- WebPartTransformer.cs
- Identity.cs
- ServicePointManager.cs
- OperationAbortedException.cs
- WorkflowRuntimeServiceElement.cs
- DefaultProxySection.cs
- HtmlCalendarAdapter.cs
- RtfFormatStack.cs
- SafePipeHandle.cs
- XpsFixedDocumentReaderWriter.cs
- FrameworkTemplate.cs
- SchemaRegistration.cs
- StringComparer.cs
- Set.cs
- NavigationProperty.cs
- MultiByteCodec.cs
- NavigatorInput.cs
- SkipQueryOptionExpression.cs
- ResourceDescriptionAttribute.cs
- _ConnectionGroup.cs
- HttpHandlersSection.cs
- Rijndael.cs
- EpmTargetTree.cs
- CollectionsUtil.cs
- _AutoWebProxyScriptEngine.cs
- TypeUtil.cs
- SubqueryRules.cs
- TriState.cs
- SerializationStore.cs
- FixedLineResult.cs
- RequestStatusBarUpdateEventArgs.cs
- TypeToArgumentTypeConverter.cs
- ToolStripRendererSwitcher.cs
- DataServiceResponse.cs
- Wildcard.cs
- ScrollEventArgs.cs
- LinkDesigner.cs
- ADConnectionHelper.cs
- MarginCollapsingState.cs
- RSAOAEPKeyExchangeFormatter.cs
- FixedSOMFixedBlock.cs