diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-07 06:02:44 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-07 06:02:44 +0000 |
commit | 288ed4ebcea335c77793ee3d207c7466d55c4f71 (patch) | |
tree | dfdf3cf06866141cdce9811cff1f7fb5ed5ad5a0 /lib/fuse_loop_mt.c | |
parent | 38f152c72decfc8a995c8a9fa7f932f348d0e1e2 (diff) |
interrupt support
Diffstat (limited to 'lib/fuse_loop_mt.c')
-rw-r--r-- | lib/fuse_loop_mt.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 47fca46..d1e327c 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -179,21 +179,24 @@ int fuse_session_loop_mt(struct fuse_session *se) fuse_mutex_init(&mt.lock); pthread_mutex_lock(&mt.lock); - fuse_start_thread(&mt); + err = fuse_start_thread(&mt); pthread_mutex_unlock(&mt.lock); - while (!fuse_session_exited(se)) - pause(); + if (!err) { + while (!fuse_session_exited(se)) + pause(); - for (w = mt.main.next; w != &mt.main; w = w->next) - pthread_cancel(w->thread_id); - mt.exit = 1; - pthread_mutex_unlock(&mt.lock); + for (w = mt.main.next; w != &mt.main; w = w->next) + pthread_cancel(w->thread_id); + mt.exit = 1; + pthread_mutex_unlock(&mt.lock); + + while (mt.main.next != &mt.main) + fuse_join_worker(&mt, mt.main.next); - while (mt.main.next != &mt.main) - fuse_join_worker(&mt, mt.main.next); + err = mt.error; + } pthread_mutex_destroy(&mt.lock); - err = mt.error; fuse_session_reset(se); return err; } |