Browse files

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.
  • Loading branch information...
1 parent 5b488c5 commit 20a4ae09bd0e723a3a500193e3d2aa79d37bf669 @demonfoo demonfoo committed Jun 28, 2011
Showing with 11 additions and 12 deletions.
  1. +10 −0 Fuse.xs
  2. +1 −12 README
View
10 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()
View
13 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

0 comments on commit 20a4ae0

Please sign in to comment.