[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 03/98: libports: fix the thread counts in case the thread creatio
From: |
Samuel Thibault |
Subject: |
[hurd] 03/98: libports: fix the thread counts in case the thread creation fails |
Date: |
Tue, 14 Jan 2014 01:59:57 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 9019e629679ec12c1a4c9656bab337e84f861e8c
Author: Justus Winter <address@hidden>
Date: Fri Nov 8 14:28:26 2013 +0100
libports: fix the thread counts in case the thread creation fails
Previously the number of total threads and the number of unused
threads was wrong if at one point the creation of a thread failed. Fix
this by decrementing both counters that were previously optimistically
incremented. Adjust the comment accordingly.
* libports/manage-multithread.c (ports_manage_port_operations_multithread):
Fix the thread counts in case the thread creation fails.
---
libports/manage-multithread.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
index 60f4c19..0c2da00 100644
--- a/libports/manage-multithread.c
+++ b/libports/manage-multithread.c
@@ -140,9 +140,13 @@ ports_manage_port_operations_multithread (struct
port_bucket *bucket,
pthread_detach (pthread_id);
else
{
- /* XXX The number of threads should be adjusted but the code
- and design of the Hurd servers just don't handle thread
- creation failure. */
+ pthread_spin_lock (&lock);
+ totalthreads--;
+ nreqthreads--;
+ pthread_spin_unlock (&lock);
+ /* There is not much we can do at this point. The code
+ and design of the Hurd servers just don't handle
+ thread creation failure. */
errno = err;
perror ("pthread_create");
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, (continued)
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13
- [hurd] 15/98: mach-defpager: include errno.h, Samuel Thibault, 2014/01/13
- [hurd] 91/98: trans/mtab: remove the loop detection logic, Samuel Thibault, 2014/01/13
- [hurd] 97/98: libnetfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 19/98: libdiskfs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function, Samuel Thibault, 2014/01/13
- [hurd] 23/98: mach-defpager: do not remove -Wall from CFLAGS, Samuel Thibault, 2014/01/13
- [hurd] 94/98: trans/mtab: do not include non-filesystem translators by default, Samuel Thibault, 2014/01/13
- [hurd] 96/98: libdiskfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 92/98: trans/mtab: properly lock mtab objects, Samuel Thibault, 2014/01/13
- [hurd] 03/98: libports: fix the thread counts in case the thread creation fails,
Samuel Thibault <=
- [hurd] 76/98: utils/settrans: fix the teardown of chrooted environments, Samuel Thibault, 2014/01/13
- [hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xlator_create, Samuel Thibault, 2014/01/13
- [hurd] 95/98: libfshelp: fix the api of fshelp_set_active_translator, Samuel Thibault, 2014/01/13
- [hurd] 98/98: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/01/13
- [hurd] 17/98: utils: implement portinfo --search, Samuel Thibault, 2014/01/13
- [hurd] 10/98: auth: fix use of uninitialized variable err, Samuel Thibault, 2014/01/13
- [hurd] 61/98: trans: fix transparent reauthentication in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 01/98: pfinet: fix emission on the loopback device, Samuel Thibault, 2014/01/13
- [hurd] 63/98: libfshelp: use a hash table in get-identity.c, Samuel Thibault, 2014/01/13
- [hurd] 90/98: trans/mtab: populate mtab objects on demand, Samuel Thibault, 2014/01/13