Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1: private bool extractWriteActions(out List<WriteChannel> channelWrites)
- 2: {
- 3: channelWrites = new List<WriteChannel>();
- 4: foreach (TpotAction action in tpotActionQueue)
- 5: {
- 6: if (action is WriteChannel)
- 7: {
- 8: channelWrites.Add((WriteChannel)action);
- 9: lock(tpotActionQueue)
- 10: {
- 11: action.Status = RecordStatus.Batched;
- 12: }
- 13: }
- 14: }
- 15: return (channelWrites.Count > 0);
- 16: }
- private bool extractWriteActions(out List<WriteChannel> channelWrites)
- {
- lock(tpotActionQueue)
- {
- channelWrites = new List<WriteChannel>();
- foreach (TpotAction action in tpotActionQueue)
- {
- if (action is WriteChannel)
- {
- channelWrites.Add((WriteChannel)action);
- action.Status = RecordStatus.Batched;
- }
- }
- }
- return (channelWrites.Count > 0);
- }
- for (int i=0; i<tpotActionQueue.Count(); i++)
- {
- TpotAction action = tpotActionQueue.Dequeue();
- if (action is WriteChannel)
- {
- channelWrites.Add((WriteChannel)action);
- lock(tpotActionQueue)
- {
- action.Status = RecordStatus.Batched;
- }
- }
- }
- for(int i = 0; i < tpotActionQueue.Length; i++)
- {
- TpotAction action = tpotActionQueue[i];
- if (action is WriteChannel)
- {
- channelWrites.Add((WriteChannel)action);
- lock(tpotActionQueue)
- {
- action.Status = RecordStatus.Batched;
- }
- }
- }
- private bool extractWriteActions(out List<WriteChannel> channelWrites)
- {
- channelWrites= tpotActionQueue.Where<WriteChannel>(x => x is WriteChannel).ToList()
- foreach(WriteChannel channel in channelWrites) {
- channel.Status = RecordStatus.Batched;
- }
- return ( channelWrites.Count > 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement