fix(v4.0.0): wire review round 1 -- tests for the wake-up order and for waking only on enough room; no overflow moving a message; sleep for impossible room answers at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-08 14:12:33 -04:00
co-authored by Claude Opus 5.5
parent d5cd64605d
commit 83694b18be
6 changed files with 68 additions and 6 deletions
+2 -2
View File
@@ -370,8 +370,8 @@ static int operate(v4_fabric *f, unsigned id, v4_cell *how)
break;
case 9: /* sleep for room */
if (!tx) { *how = V4_WIRE_NO_ONE; break; }
if (a < 0) { *how = V4_WIRE_NOT_A_MESSAGE; break; }
if (a <= (v4_cell)V4_WIRE_CELLS && v4_wire_room(tx, (unsigned)a) == V4_WIRE_DONE) { *how = V4_WIRE_DONE; break; }
if (a < 0 || a > (v4_cell)V4_WIRE_CELLS) { *how = V4_WIRE_NO_ROOM; break; } /* no waiting can make that room */
if (v4_wire_room(tx, (unsigned)a) == V4_WIRE_DONE) { *how = V4_WIRE_DONE; break; }
if (!arrived(f, id)) return 0;
*how = V4_WIRE_NO_ROOM;
break;