This would allow an embedder to suspend the current Janet fiber
via an external event like a signal, other thread, or really anything.
This is a useful primitive for custom schedulers that would call
janet_interpreter_interupt periodically (say, in an interval with SIG_ALRM),
do some work, and then use janet_continue on the janet_root_fiber, or
for embedding into other soft-realtime applications like a game. To say,
only allow about 5ms per frame of interpreter time.
JPM and related functionality has been moved to it's own repository
and will be versioned separately from Janet. The distribution process
could later be modified to bundle a version of jpm with Janet but this
is perhaps not needed.
Fix the following build failure with -Dsingle_threaded=true on embedded
toolchains without pthread:
FAILED: janet.p/meson-generated_.._janet.c.o
/home/buildroot/autobuild/run/instance-3/output-1/host/bin/arm-linux-gcc -Ijanet.p -I. -I.. -I../src/include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -std=c99 -O3 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pthread -fvisibility=hidden -MD -MQ janet.p/meson-generated_.._janet.c.o -MF janet.p/meson-generated_.._janet.c.o.d -o janet.p/meson-generated_.._janet.c.o -c janet.c
In file included from /home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/stdlib.h:24,
from ../src/include/janet.h:300,
from src/core/features.h:57:
/home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/features.h:218:5: warning: #warning requested reentrant code, but thread support was disabled [-Wcpp]
218 | # warning requested reentrant code, but thread support was disabled
| ^~~~~~~
src/core/ev.c:39:10: fatal error: pthread.h: No such file or directory
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Since Meson 0.51, there are special build options for "native:true"
builds, prefixed with "build.". This change breaks cross builds
because `janet-boot/src_core_asm.c` is no longer built with `-std=c99`:
FAILED: janet-boot.p/src_core_asm.c.o
/usr/bin/gcc -Ijanet-boot.p -I. -I.. -I../src/include -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -pthread -DJANET_BOOTSTRAP -MD -MQ janet-boot.p/src_core_asm.c.o -MF janet-boot.p/src_core_asm.c.o.d -o janet-boot.p/src_core_asm.c.o -c ../src/core/asm.c
../src/core/asm.c: In function 'janet_disasm_bytecode':
../src/core/asm.c:866:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (int32_t i = 0; i < def->bytecode_length; i++) {
^
Fixes:
- http://autobuild.buildroot.net/results/355e0992338a8d132050517f83a3884606b00529
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Don't search for cross compilerUnless needed.
This should help prevent issues building Meson on debian. Also
fix issue using the wrong set of flags to build the native janet
interpreter vs. the cross compiled janet interpreter.