futures: Limit the number of nested futures on the same stack.
Fixes <http://bugs.gnu.org/13188>.
Reported by Nala Ginrut <nalaginrut@gmail.com>.
* module/ice-9/futures.scm (%nesting-level): Rename to...
(%nesting-level): ... this. Default to 0 instead of #f. Update
users.
(%max-nesting-level): New variable.
(touch): When FUTURE is queued and (%nesting-level) is above
%MAX-NESTING-LEVEL, abort to %FUTURE-PROMPT.
* test-suite/tests/future.test ("nested futures")["loop"]: Remove
`compile' call.
* test-suite/tests/threads.test ("par-map")["long list"]: New test.
* doc/ref/api-scheduling.texi (Futures): Add a paragraph about stack
consumption.