diff options
| author | Vallish Vaidyeshwara <Vallish.Vaidyeshwara@Sun.COM> | 2008-11-18 03:52:46 -0800 |
|---|---|---|
| committer | Vallish Vaidyeshwara <Vallish.Vaidyeshwara@Sun.COM> | 2008-11-18 03:52:46 -0800 |
| commit | f7b93e0c289f7c2bc496d313146b7af1bd0bf84e (patch) | |
| tree | bf3eb0590ffca102f77890ff48bbb6148bab6699 /usr/src/cmd | |
| parent | f9c1591d75a5b335f06e3a8d0787bb812b588c01 (diff) | |
| download | illumos-joyent-f7b93e0c289f7c2bc496d313146b7af1bd0bf84e.tar.gz | |
6761285 svc_run() should not unregister the pool
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/fs.d/nfs/lib/thrpool.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/usr/src/cmd/fs.d/nfs/lib/thrpool.c b/usr/src/cmd/fs.d/nfs/lib/thrpool.c index 8d79c6da20..bbab8613c6 100644 --- a/usr/src/cmd/fs.d/nfs/lib/thrpool.c +++ b/usr/src/cmd/fs.d/nfs/lib/thrpool.c @@ -46,21 +46,17 @@ svcstart(void *arg) { int id = (int)arg; - while (_nfssys(SVCPOOL_RUN, &id) < 0) { - /* - * Interrupted by a signal while in the kernel. - * this process is still alive, try again. - */ - if (errno == EINTR) - continue; - else - break; - } + /* + * Create a kernel worker thread to service + * new incoming requests on a pool. + */ + _nfssys(SVCPOOL_RUN, &id); /* - * If we weren't interrupted by a signal, but did - * return from the kernel, this thread's work is done, - * and it should exit. + * Returned from the kernel, this thread's work is done, + * and it should exit. For new incoming requests, + * svcblock() will spawn another worker thread by + * calling svcstart() again. */ thr_exit(NULL); return (NULL); @@ -102,14 +98,15 @@ svcblock(void *arg) * until a thread needs to be created. */ if (_nfssys(SVCPOOL_WAIT, &id) < 0) { - if (errno == ECANCELED || errno == EBUSY) + if (errno == ECANCELED || errno == EINTR || + errno == EBUSY) /* - * If we get back ECANCELED, the service - * pool is exiting, and we may as well - * clean up this thread. If EBUSY is - * returned, there's already a thread - * looping on this pool, so we should - * give up. + * If we get back ECANCELED or EINTR, + * the service pool is exiting, and we + * may as well clean up this thread. If + * EBUSY is returned, there's already a + * thread looping on this pool, so we + * should give up. */ break; else |
