12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #include <libguile.h>
- #include <time.h>
- #include <stdlib.h>
- static SCM
- thread_main (void *data)
- {
- return SCM_BOOL_T;
- }
- static SCM
- thread_handler (void *data, SCM key, SCM args)
- {
- return SCM_BOOL_T;
- }
- static void *
- inner_main (void *data)
- {
- SCM thread, timeout;
- thread = scm_spawn_thread (thread_main, 0, thread_handler, 0);
- timeout = scm_from_unsigned_integer (time (NULL) + 10);
- return SCM2PTR (scm_join_thread_timed (thread, timeout, SCM_BOOL_F));
- }
- int
- main (int argc, char **argv)
- {
- SCM result;
- result = PTR2SCM (scm_with_guile (inner_main, 0));
- return scm_is_true (result) ? EXIT_SUCCESS : EXIT_FAILURE;
- }
|