diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-01-04 12:45:54 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-01-04 12:45:54 +0000 |
commit | 0f62d7265ebab7807978ae8a206213d968bea9e4 (patch) | |
tree | 5039e673540eb681b78849f665beb5efed2bcc54 /lib/fuse_mt.c | |
parent | 0fcfa039c1dfb7cf9d9da132972334e33f320dd1 (diff) | |
download | libfuse-0f62d7265ebab7807978ae8a206213d968bea9e4.tar.gz |
interrupted request improvements
Diffstat (limited to 'lib/fuse_mt.c')
-rw-r--r-- | lib/fuse_mt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/fuse_mt.c b/lib/fuse_mt.c index 94d3bb8..c02d5c4 100644 --- a/lib/fuse_mt.c +++ b/lib/fuse_mt.c @@ -40,9 +40,9 @@ static void *do_work(void *data) ctx = (struct fuse_context *) malloc(sizeof(struct fuse_context)); if (ctx == NULL) { fprintf(stderr, "fuse: failed to allocate fuse context\n"); - pthread_mutex_lock(&f->lock); + pthread_mutex_lock(&f->worker_lock); f->numavail --; - pthread_mutex_unlock(&f->lock); + pthread_mutex_unlock(&f->worker_lock); return NULL; } pthread_setspecific(context_key, ctx); @@ -61,7 +61,7 @@ static void *do_work(void *data) continue; if (f->numavail == 0 && f->numworker < FUSE_MAX_WORKERS) { - pthread_mutex_lock(&f->lock); + pthread_mutex_lock(&f->worker_lock); if (f->numworker < FUSE_MAX_WORKERS) { /* FIXME: threads should be stored in a list instead of an array */ @@ -69,15 +69,15 @@ static void *do_work(void *data) pthread_t *thread_id = &w->threads[f->numworker]; f->numavail ++; f->numworker ++; - pthread_mutex_unlock(&f->lock); + pthread_mutex_unlock(&f->worker_lock); res = start_thread(w, thread_id); if (res == -1) { - pthread_mutex_lock(&f->lock); + pthread_mutex_lock(&f->worker_lock); f->numavail --; - pthread_mutex_unlock(&f->lock); + pthread_mutex_unlock(&f->worker_lock); } } else - pthread_mutex_unlock(&f->lock); + pthread_mutex_unlock(&f->worker_lock); } w->proc(w->f, cmd, w->data); |