public void ChangeQueuePriority(Guid queue, int priority) { QueueBuffer queueBuffer = null; lock (queueBuffers) { if (queueBuffers.ContainsKey(queue)) { queueBuffer = queueBuffers[queue]; queueBuffer.CurrentPriority = priority; } } }
private QueueBuffer[] CopyQueueBuffersToArray() { QueueBuffer[] buffers = null; lock (queueBuffers) { var queueCount = queueBuffers.Count; buffers = new QueueBuffer[queueCount]; int index = 0; foreach (var queueBuffer in queueBuffers) { buffers[index++] = queueBuffer.Value; } } return(buffers); }
private byte[] GetBufferForQueue(Guid queue, int priority) { QueueBuffer queueBuffer = null; lock (queueBuffers) { if (queueBuffers.ContainsKey(queue)) { queueBuffer = queueBuffers[queue]; queueBuffer.CurrentPriority = priority; return(queueBuffer.Buffer); } } return(null); }
public QueueBuffer CreateQueue(Guid queue, int priority) { lock (queueBuffers) { QueueBuffer queueBuffer = null; if (!queueBuffers.ContainsKey(queue)) { queueBuffer = new QueueBuffer(busLength); queueBuffer.CurrentPriority = priority; queueBuffers.Add(queue, queueBuffer); } else { queueBuffer = queueBuffers[queue]; } return(queueBuffer); } }