1 /* Copyright (C) 2008 Free Software Foundation, Inc.
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 void *thread_inner_main (void *unused);
26 void *thread_main (void *unused);
27 void *do_join (void *data);
28 void *inner_main (void *unused);
31 thread_inner_main (void *unused)
37 "(or (current-module) (exit -1))",
41 scm_shell (argc, argv);
43 return NULL; /* dummy */
47 thread_main (void *unused)
49 scm_with_guile (&thread_inner_main, NULL);
51 return NULL; /* dummy */
57 pthread_t *thread = (pthread_t *) data;
59 pthread_join (*thread, NULL);
61 return NULL; /* dummy */
65 inner_main (void *unused)
69 pthread_create (&thread, NULL, &thread_main, NULL);
70 scm_without_guile (do_join, &thread);
72 return NULL; /* dummy */
76 main (int argc, char **argv)
78 scm_with_guile (&inner_main, NULL);