From 76c3ad98350759d0a6015d15af5463652d598006 Mon Sep 17 00:00:00 2001 From: Michael Schimmel Date: Sun, 25 Jan 2026 02:03:23 +0100 Subject: [PATCH] Streams refactoring --- Src/AST/Myc.Ast.Evaluator.pas | 2 +- Src/Data/Myc.Data.Stream.pas | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Src/AST/Myc.Ast.Evaluator.pas b/Src/AST/Myc.Ast.Evaluator.pas index f802b8f..4fecee6 100644 --- a/Src/AST/Myc.Ast.Evaluator.pas +++ b/Src/AST/Myc.Ast.Evaluator.pas @@ -616,7 +616,7 @@ begin begin SetLength(args, Length(S)); for k := 0 to High(S) do - args[k] := S[k].Items[0]; + args[k] := S[k]; res := lambdaFunc(args); diff --git a/Src/Data/Myc.Data.Stream.pas b/Src/Data/Myc.Data.Stream.pas index 81a94af..9c42645 100644 --- a/Src/Data/Myc.Data.Stream.pas +++ b/Src/Data/Myc.Data.Stream.pas @@ -294,15 +294,7 @@ procedure TPipeStream.CheckBarrierAndFire(CurrentCycle: Int64); var resultVal: TArray; begin - // We reuse the FObservers lock from the base class to protect state - // But since FObservers is private, we access it via method or need to make it protected. - // Making it protected or using a separate lock is cleaner. - // For now, let's assume we rely on the fact that OnSignal is usually serialized per thread - // or add a lock. - // -> Ideally, TCustomDataStream should expose Lock/Unlock or we add a Lock here. - - // Simplification: We assume thread safety is handled by the caller or we add a dedicated lock. - // For this example, let's just do the logic: + // We assume thread safety is handled by the caller for var src in FSources do if src.LastSeenCycle < CurrentCycle then