/// <summary> /// Deactivates an active <see cref="ThreadState"/>. Inactive <see cref="ThreadState"/> can /// not be used for indexing anymore once they are deactivated. This method should only be used /// if the parent <see cref="DocumentsWriter"/> is closed or aborted. /// </summary> /// <param name="threadState"> the state to deactivate </param> internal virtual void DeactivateThreadState(ThreadState threadState) { if (Debugging.AssertsEnabled) { Debugging.Assert(threadState.IsActive); } threadState.Deactivate(); }
internal static void DeactivateThreadState(ThreadState threadState) // LUCENENET: CA1822: Mark members as static { if (Debugging.AssertsEnabled) { Debugging.Assert(threadState.IsActive); } threadState.Deactivate(); }
internal virtual DocumentsWriterPerThread Reset(ThreadState threadState, bool closed) { //Debug.Assert(threadState.HeldByCurrentThread); DocumentsWriterPerThread dwpt = threadState.dwpt; if (!closed) { threadState.Reset(); } else { threadState.Deactivate(); } return(dwpt); }
internal static DocumentsWriterPerThread Reset(ThreadState threadState, bool closed) // LUCENENET: CA1822: Mark members as static { if (Debugging.AssertsEnabled) { Debugging.Assert(threadState.IsHeldByCurrentThread); } DocumentsWriterPerThread dwpt = threadState.dwpt; if (!closed) { threadState.Reset(); } else { threadState.Deactivate(); } return(dwpt); }
internal DocumentsWriterPerThread Reset(ThreadState threadState, bool closed) { if (Debugging.AssertsEnabled) { Debugging.Assert(threadState.IsHeldByCurrentThread); } DocumentsWriterPerThread dwpt = threadState.dwpt; if (!closed) { threadState.Reset(); } else { threadState.Deactivate(); } return(dwpt); }
/// <summary> /// Deactivate all unreleased threadstates /// </summary> internal virtual void DeactivateUnreleasedStates() { lock (this) { for (int i = numThreadStatesActive; i < threadStates.Length; i++) { ThreadState threadState = threadStates[i]; threadState.@Lock(); try { threadState.Deactivate(); } finally { threadState.Unlock(); } } } }
/// <summary> /// Deactivate all unreleased threadstates /// </summary> internal void DeactivateUnreleasedStates() { UninterruptableMonitor.Enter(this); try { for (int i = numThreadStatesActive; i < threadStates.Length; i++) { ThreadState threadState = threadStates[i]; threadState.@Lock(); try { threadState.Deactivate(); } finally { threadState.Unlock(); } } } finally { UninterruptableMonitor.Exit(this); } }
/// <summary> /// Deactivates an active <see cref="ThreadState"/>. Inactive <see cref="ThreadState"/> can /// not be used for indexing anymore once they are deactivated. This method should only be used /// if the parent <see cref="DocumentsWriter"/> is closed or aborted. /// </summary> /// <param name="threadState"> the state to deactivate </param> internal virtual void DeactivateThreadState(ThreadState threadState) { Debug.Assert(threadState.IsActive); threadState.Deactivate(); }
internal virtual DocumentsWriterPerThread Reset(ThreadState threadState, bool closed) { //Debug.Assert(threadState.HeldByCurrentThread); DocumentsWriterPerThread dwpt = threadState.Dwpt; if (!closed) { threadState.Reset(); } else { threadState.Deactivate(); } return dwpt; }
/// <summary> /// Deactivates an active <seealso cref="ThreadState"/>. Inactive <seealso cref="ThreadState"/> can /// not be used for indexing anymore once they are deactivated. this method should only be used /// if the parent <seealso cref="DocumentsWriter"/> is closed or aborted. /// </summary> /// <param name="threadState"> the state to deactivate </param> internal virtual void DeactivateThreadState(ThreadState threadState) { Debug.Assert(threadState.Active); threadState.Deactivate(); }