diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2020-03-16 17:47:02 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2020-03-20 10:42:52 +0100 |
commit | f5b97219d7e44569612a17e7b257f97b8f723d72 (patch) | |
tree | ebd13f34ea6b9c7ed33eed82f925207f35442d9a /src/lib/tpm.c | |
parent | 51d8f69fb152ae5a47151c2f132fd4263ec3d144 (diff) | |
download | ouroboros-f5b97219d7e44569612a17e7b257f97b8f723d72.tar.gz ouroboros-f5b97219d7e44569612a17e7b257f97b8f723d72.zip |
lib: Fix thread management in thread pool manager
The thread pool manager wasn't counting working threads when deciding
to create new ones, resulting in constant starting of new threads when
threads were busy.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/tpm.c')
-rw-r--r-- | src/lib/tpm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/tpm.c b/src/lib/tpm.c index 0ba9619b..ff0a22df 100644 --- a/src/lib/tpm.c +++ b/src/lib/tpm.c @@ -159,7 +159,7 @@ static void * tpmgr(void * o) if (pthread_cond_timedwait(&tpm->cond, &tpm->lock, &dl) == ETIMEDOUT) - if (tpm->cur > tpm->min) + if (tpm->cur - tpm->wrk > tpm->min) tpm_kill(tpm); pthread_mutex_unlock(&tpm->lock); |