bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Keep at least one request handler thread.


From: Diego Nieto Cid
Subject: [PATCH] Keep at least one request handler thread.
Date: Sun, 30 Oct 2011 18:07:02 -0300

* libports/manage-multithread.c: Startover when no other thread is
listenening for requests.
---
 libports/manage-multithread.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
index 6ec1e49..e95657e 100644
--- a/libports/manage-multithread.c
+++ b/libports/manage-multithread.c
@@ -150,6 +150,11 @@ ports_manage_port_operations_multithread (struct 
port_bucket *bucket,
       else
        {
          spin_lock (&lock);
+         if (nreqthreads == 1)
+           {
+             spin_unlock (&lock);
+             goto startover;
+           }
          nreqthreads--;
          totalthreads--;
          spin_unlock (&lock);
-- 
1.7.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]