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 License
5 * as published by the Free Software Foundation; either version 3 of
6 * the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful, but
9 * 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
26 void *thread_inner_main (void *unused
);
27 void *thread_main (void *unused
);
28 void *do_join (void *data
);
29 void *inner_main (void *unused
);
32 thread_inner_main (void *unused
)
38 "(or (current-module) (exit -1))",
42 scm_shell (argc
, argv
);
44 return NULL
; /* dummy */
48 thread_main (void *unused
)
50 scm_with_guile (&thread_inner_main
, NULL
);
52 return NULL
; /* dummy */
58 pthread_t
*thread
= (pthread_t
*) data
;
60 pthread_join (*thread
, NULL
);
62 return NULL
; /* dummy */
66 inner_main (void *unused
)
70 pthread_create (&thread
, NULL
, &thread_main
, NULL
);
71 scm_without_guile (do_join
, &thread
);
73 return NULL
; /* dummy */
77 main (int argc
, char **argv
)
79 scm_with_guile (&inner_main
, NULL
);