diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-04-25 23:59:12 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-04-25 23:59:42 +0200 |
commit | 7c86abd9ce9671c82a06d373ec8d1b847ec8d0bd (patch) | |
tree | 2a63166b3dac7c4df4d85a639e65e64a6c5d6848 | |
parent | dd7d0148f221c3180ab6f31c8742aaf4d0e5926a (diff) | |
download | guile-7c86abd9ce9671c82a06d373ec8d1b847ec8d0bd.tar.gz |
Use `scm_with_guile' in `test-pthread-create'.
* test-suite/standalone/test-pthread-create.c (inner_main): New
function.
(main): Call it within `scm_with_guile', instead of using
`scm_init_guile'. This improves portability--e.g.,
`GC_get_stack_base', used by `scm_init_guile', failed on Darwin
up to BDW-GC 7.1alpha4 included (thanks, Mark, for the hint.)
-rw-r--r-- | test-suite/standalone/test-pthread-create.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test-suite/standalone/test-pthread-create.c b/test-suite/standalone/test-pthread-create.c index 8d9617b58..cf3771f07 100644 --- a/test-suite/standalone/test-pthread-create.c +++ b/test-suite/standalone/test-pthread-create.c @@ -42,15 +42,12 @@ thread (void *arg) return NULL; } - -int -main (int argc, char *argv[]) +static void * +inner_main (void *data) { int i; pthread_t thr; - scm_init_guile (); - do_something (NULL); for (i = 0; i < 77; i++) @@ -59,5 +56,14 @@ main (int argc, char *argv[]) pthread_join (thr, NULL); } + return NULL; +} + + +int +main (int argc, char *argv[]) +{ + scm_with_guile (inner_main, NULL); + return EXIT_SUCCESS; } |