I've never used them, but the heartbeat functions are supposed to be
invisible when JS_THREADSAFE.
It sounds like you are building a thread-safe JSAPI for a single-threaded
environment. This is fine, and will likely be the only option in future
JSAPIs.
My recommendation is to use a second "watchdog" thread to keep an eye on
your JS-running thread. If JSAPI does not return fast enough, you can
trigger an operation callback which then returns JS_FALSE and aborts the
execution of your JS code.
If you are in an environment where the compiler does not support threads
(e.g. embedded systems), you can do something similar with timers or
alarm().
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102