/// <summary> /// Sets the processor. /// </summary> /// <param name="proc">The proc.</param> public void SetProcessor(IUnmanagedTarget proc) { Debug.Assert(proc != null); lock (_syncRoot) { _proc = proc; // Preload enabled levels. _enabledLevels.AddRange( new[] { LogLevel.Trace, LogLevel.Debug, LogLevel.Info, LogLevel.Warn, LogLevel.Error } .Where(x => UnmanagedUtils.ProcessorLoggerIsLevelEnabled(proc, (int)x))); foreach (var log in _pendingLogs) { Log(log.Item1, log.Item2, log.Item3, log.Item4); } } }
/** <inheritDoc /> */ public void Close() { UnmanagedUtils.AtomicReferenceClose(Target); }
/** <inheritDoc /> */ public void Close() { UnmanagedUtils.AtomicSequenceClose(Target); }
/** <inheritDoc /> */ public long Add(long value) { return(UnmanagedUtils.AtomicSequenceAddAndGet(Target, value)); }
/** <inheritDoc /> */ public long Increment() { return(UnmanagedUtils.AtomicSequenceIncrementAndGet(Target)); }
/** <inheritDoc /> */ public long Read() { return(UnmanagedUtils.AtomicSequenceGet(Target)); }
/// <summary> /// Re-allocate external memory chunk. /// </summary> /// <param name="memPtr">Memory pointer.</param> /// <param name="cap">CalculateCapacity.</param> /// <returns>New memory pointer.</returns> public static void ReallocateExternal(long memPtr, int cap) { UnmanagedUtils.Reallocate(memPtr, cap); }