From 20a4ae09bd0e723a3a500193e3d2aa79d37bf669 Mon Sep 17 00:00:00 2001 From: Derrik Pates Date: Tue, 28 Jun 2011 19:08:27 -0600 Subject: [PATCH] Make the code work without USE_ITHREADS. FreeBSD's default Perl build doesn't enable threads (it can be enabled), so let's try to be a bit more accepting. --- Fuse.xs | 10 ++++++++++ README | 13 +------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Fuse.xs b/Fuse.xs index fb3686f..f84aa49 100755 --- a/Fuse.xs +++ b/Fuse.xs @@ -39,9 +39,13 @@ typedef struct { SV *callback[N_CALLBACKS]; HV *handles; +#ifdef USE_ITHREADS tTHX self; +#endif int threaded; +#ifdef USE_ITHREADS perl_mutex mutex; +#endif } my_cxt_t; START_MY_CXT; @@ -1520,14 +1524,19 @@ PROTOTYPES: DISABLE BOOT: MY_CXT_INIT; +#ifdef USE_ITHREADS MY_CXT.self = aTHX; +#endif void CLONE(...) PREINIT: +#ifdef USE_ITHREADS int i; dTHX; +#endif CODE: +#ifdef USE_ITHREADS MY_CXT_CLONE; tTHX parent = MY_CXT.self; MY_CXT.self = my_perl; @@ -1559,6 +1568,7 @@ CLONE(...) clone_params_del(clone_param); #endif } +#endif SV* fuse_get_context() diff --git a/README b/README index 229e9ee..1a66bce 100644 --- a/README +++ b/README @@ -93,18 +93,7 @@ Currently tests have been attempted and succeeded on: * FreeBSD 8.2/amd64 * MacOS X 10.6.7 -Note that currently, this module requires a threaded Perl. This is not a -problem on most operating systems, but FreeBSD does not build Perl in -ports with threading enabled. You'll need to build it yourself. You can use -Perl 5.8, 5.10, or 5.12, but you'll need to: - - cd /usr/ports/lang/perl$VERSION - make config - [enable THREADS and choose OK] - make - make install - -Also note that on NetBSD, there are several bugs in libpuffs and librefuse +Note that on NetBSD, there are several bugs in libpuffs and librefuse which prevent some tests from succeeding. There are fixes in NetBSD's MAIN branch, specifically revisions 1.26 and 1.27 on src/lib/libpuffs/subr.c, which correct the issues that cause the test failures. However, there is -- 2.20.1