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
- ListItemCollection.cs
- keycontainerpermission.cs
- Array.cs
- CommandLibraryHelper.cs
- DataViewManager.cs
- Attachment.cs
- EditorZoneBase.cs
- CompilerError.cs
- SoapSchemaMember.cs
- PageCodeDomTreeGenerator.cs
- OpCodes.cs
- DataGridTable.cs
- ItemCollection.cs
- HitTestFilterBehavior.cs
- SchemaImporterExtensionElementCollection.cs
- DSASignatureFormatter.cs
- RuntimeVariablesExpression.cs
- XmlDocumentType.cs
- SqlDataSourceSummaryPanel.cs
- Thread.cs
- ExpressionBuilder.cs
- ClientApiGenerator.cs
- BufferedReadStream.cs
- HandlerBase.cs
- CustomError.cs
- LookupTables.cs
- PersonalizationStateQuery.cs
- XmlC14NWriter.cs
- LineGeometry.cs
- TableHeaderCell.cs
- ContractSearchPattern.cs
- BreakRecordTable.cs
- HierarchicalDataSourceControl.cs
- ForEachAction.cs
- _ConnectStream.cs
- Latin1Encoding.cs
- List.cs
- SerialReceived.cs
- WebPartDisplayModeCancelEventArgs.cs
- EmptyReadOnlyDictionaryInternal.cs
- ServiceTimeoutsElement.cs
- HttpResponse.cs
- TextSerializer.cs
- XmlAtomicValue.cs
- CommandEventArgs.cs
- URL.cs
- TextBoxAutomationPeer.cs
- TextDecoration.cs
- HttpModulesSection.cs
- MediaPlayerState.cs
- FunctionNode.cs
- wgx_commands.cs
- WindowsSecurityToken.cs
- ConfigXmlText.cs
- BindingValueChangedEventArgs.cs
- CategoryNameCollection.cs
- StructureChangedEventArgs.cs
- EventArgs.cs
- WindowsListViewItemStartMenu.cs
- FixedSOMElement.cs
- TabletCollection.cs
- TextRangeProviderWrapper.cs
- _ConnectOverlappedAsyncResult.cs
- HtmlControlPersistable.cs
- BaseTemplateCodeDomTreeGenerator.cs
- CodeArgumentReferenceExpression.cs
- PlanCompiler.cs
- CompositeActivityTypeDescriptor.cs
- MeasurementDCInfo.cs
- SQLDateTimeStorage.cs
- FlowLayout.cs
- DbParameterHelper.cs
- TimeEnumHelper.cs
- Journaling.cs
- TableCell.cs
- Rectangle.cs
- FormatConvertedBitmap.cs
- CodeIdentifiers.cs
- CommonProperties.cs
- TextBoxAutoCompleteSourceConverter.cs
- GridViewRowPresenterBase.cs
- GridErrorDlg.cs
- ReadOnlyCollectionBuilder.cs
- MediaSystem.cs
- PageStatePersister.cs
- GroupBox.cs
- RayHitTestParameters.cs
- PageBreakRecord.cs
- DoubleAnimationUsingPath.cs
- AccessDataSourceDesigner.cs
- ValidationSummary.cs
- PngBitmapDecoder.cs
- HashCodeCombiner.cs
- HwndStylusInputProvider.cs
- StringFormat.cs
- ResourcesChangeInfo.cs
- SchemaDeclBase.cs
- DocumentPageViewAutomationPeer.cs
- ThousandthOfEmRealDoubles.cs
- GroupBoxDesigner.cs