public uint HandleLogFull(HandleLogFullCallback callback) { ManualResetEvent doneEvent = null; uint queuedErrorCode = Error.ERROR_SUCCESS; if (callback == null) { doneEvent = new ManualResetEvent(false); callback = delegate(uint code) { queuedErrorCode = code; doneEvent.Set(); }; } uint errorCode = Error.ERROR_IO_PENDING; lock (this.SyncRoot) { EnsureStarted(); if (this.handleLogFullCallbackList == null) { this.handleLogFullCallbackList = new List <HandleLogFullCallback>(); errorCode = UnsafeNativeMethods.HandleLogFull( this.logStore.Handle); if (errorCode != Error.ERROR_IO_PENDING) { return(errorCode); } } this.handleLogFullCallbackList.Add(callback); } if (doneEvent != null) { if (doneEvent.WaitOne(MaxLogFullNotificationTimeOut, false)) { // Got ClfsMgmtLogFullHandlerNotification notification from CLFS errorCode = queuedErrorCode; } else { // Time out! We never got ClfsMgmtLogFullHandlerNotification notification from CLFS! // Remove the Callback from the Callback list. lock (this.SyncRoot) { this.handleLogFullCallbackList.Remove(callback); } errorCode = Error.ERROR_LOG_FULL; } doneEvent.Close(); } return(errorCode); }
public uint HandleLogFull(HandleLogFullCallback callback) { ManualResetEvent doneEvent = null; uint queuedErrorCode = Error.ERROR_SUCCESS; if (callback == null) { doneEvent = new ManualResetEvent(false); callback = delegate(uint code) { queuedErrorCode = code; doneEvent.Set(); }; } uint errorCode = Error.ERROR_IO_PENDING; lock (this.SyncRoot) { EnsureStarted(); if (this.handleLogFullCallbackList == null) { this.handleLogFullCallbackList = new List<HandleLogFullCallback>(); errorCode = UnsafeNativeMethods.HandleLogFull( this.logStore.Handle); if (errorCode != Error.ERROR_IO_PENDING) { return errorCode; } } this.handleLogFullCallbackList.Add(callback); } if (doneEvent != null) { if (doneEvent.WaitOne(MaxLogFullNotificationTimeOut, false)) { // Got ClfsMgmtLogFullHandlerNotification notification from CLFS errorCode = queuedErrorCode; } else { // Time out! We never got ClfsMgmtLogFullHandlerNotification notification from CLFS! // Remove the Callback from the Callback list. lock (this.SyncRoot) { this.handleLogFullCallbackList.Remove(callback); } errorCode = Error.ERROR_LOG_FULL; } doneEvent.Close(); } return errorCode; }
uint InvokePolicyEngine() { HandleLogFullCallback callback = null; if (this.asyncResult != null) { callback = new HandleLogFullCallback(this.asyncResult.IOCompleted); } LogManagementAsyncResult logManagement; logManagement = this.recordSequence.LogStore.LogManagement; return(logManagement.HandleLogFull(callback)); }
uint InvokePolicyEngine() { HandleLogFullCallback callback = null; if (this.asyncResult != null) { callback = new HandleLogFullCallback(this.asyncResult.IOCompleted); } LogManagementAsyncResult logManagement; logManagement = this.recordSequence.LogStore.LogManagement; return logManagement.HandleLogFull(callback); }