aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-03-21 11:47:04 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-03-21 11:47:04 +0000
commitd17da46055903a517274b7823d41fdd866f48d8d (patch)
tree2be8f2ac524462d084c438daf51a6ee6a7dc84ad /lib
parent6083f17e69c6074ad606aa9195d086b1be46428b (diff)
downloadlibfuse-d17da46055903a517274b7823d41fdd866f48d8d.tar.gz
Merge 2_2_bugfix up to 2_2_merge1
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_mt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/fuse_mt.c b/lib/fuse_mt.c
index 2e43671..819a2b9 100644
--- a/lib/fuse_mt.c
+++ b/lib/fuse_mt.c
@@ -12,6 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
+#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
@@ -36,6 +37,7 @@ static void *do_work(void *data)
struct fuse_worker *w = (struct fuse_worker *) data;
struct fuse *f = w->f;
struct fuse_context *ctx;
+ int is_mainthread = (f->numworker == 1);
ctx = (struct fuse_context *) malloc(sizeof(struct fuse_context));
if (ctx == NULL) {
@@ -83,6 +85,10 @@ static void *do_work(void *data)
w->proc(w->f, cmd, w->data);
}
+ /* Wait for cancellation */
+ if (!is_mainthread)
+ pause();
+
return NULL;
}