[PATCH] unlock cond_mutex before thread exit in gp_worker_main()
by Guiyao
Hi,
An unlock was missed before pthread_exit in function gp_worker_main()
Signed-off-by: GuiYao <guiyao(a)huawei.com>
---
diff --git a/src/gp_workers.c b/src/gp_workers.c
index 18f38f6..ae42cef 100644
--- a/src/gp_workers.c
+++ b/src/gp_workers.c
@@ -369,6 +369,7 @@ static void *gp_worker_main(void *pvt)
/* wait for next query */
pthread_cond_wait(&t->cond_wakeup, &t->cond_mutex);
if (t->pool->shutdown) {
+ pthread_mutex_unlock(&t->cond_mutex);
pthread_exit(NULL);
}
}
3 years, 8 months
branch master updated: Unlock cond_mutex before pthread exit in gp_worker_main()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
rharwood pushed a commit to branch master
in repository gssproxy.
The following commit(s) were added to refs/heads/master by this push:
new cb76141 Unlock cond_mutex before pthread exit in gp_worker_main()
cb76141 is described below
commit cb761412e299ef907f22cd7c4146d50c8a792003
Author: Guiyao <guiyao(a)huawei.com>
AuthorDate: Thu Mar 26 06:33:35 2020 +0000
Unlock cond_mutex before pthread exit in gp_worker_main()
Signed-off-by: GuiYao <guiyao(a)huawei.com>
[rharwood(a)redhat.com: whitespace, tweak commit message]
Reviewed-by: Robbie Harwood <rharwood(a)redhat.com>
---
src/gp_workers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gp_workers.c b/src/gp_workers.c
index 18f38f6..ae42cef 100644
--- a/src/gp_workers.c
+++ b/src/gp_workers.c
@@ -369,6 +369,7 @@ static void *gp_worker_main(void *pvt)
/* wait for next query */
pthread_cond_wait(&t->cond_wakeup, &t->cond_mutex);
if (t->pool->shutdown) {
+ pthread_mutex_unlock(&t->cond_mutex);
pthread_exit(NULL);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 8 months
branch master updated: Use getrandom() for picking xid initial offset
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
rharwood pushed a commit to branch master
in repository gssproxy.
The following commit(s) were added to refs/heads/master by this push:
new 23c5215 Use getrandom() for picking xid initial offset
23c5215 is described below
commit 23c52157c932017bab359e296d7baa2f71239a70
Author: Simo Sorce <simo(a)redhat.com>
AuthorDate: Mon Mar 23 16:04:15 2020 -0400
Use getrandom() for picking xid initial offset
Although this place id not cryptgraphically relevant, there is no point
in not using a proper random value: we call into krb5, which uses
getrandom() as well.
Signed-off-by: Simo Sorce <simo(a)redhat.com>
[rharwood(a)redhat.com: Rewrote commit message]
Reviewed-by: Robbie Harwood <rharwood(a)redhat.com>
Merges: #255
---
src/client/gpm_common.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/client/gpm_common.c b/src/client/gpm_common.c
index 808f350..60b1fdc 100644
--- a/src/client/gpm_common.c
+++ b/src/client/gpm_common.c
@@ -9,6 +9,7 @@
#include <pthread.h>
#include <sys/epoll.h>
#include <fcntl.h>
+#include <sys/random.h>
#include <sys/timerfd.h>
#define FRAGMENT_BIT (1 << 31)
@@ -41,7 +42,9 @@ pthread_once_t gpm_init_once_control = PTHREAD_ONCE_INIT;
static void gpm_init_once(void)
{
pthread_mutexattr_t attr;
- unsigned int seedp;
+ char *buf = (char *)&gpm_global_ctx.next_xid;
+ size_t len = sizeof(gpm_global_ctx.next_xid);
+ size_t ret = 0;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
@@ -52,8 +55,9 @@ static void gpm_init_once(void)
gpm_global_ctx.epollfd = -1;
gpm_global_ctx.timerfd = -1;
- seedp = time(NULL) + getpid() + pthread_self();
- gpm_global_ctx.next_xid = rand_r(&seedp);
+ while(ret < len) {
+ ret += getrandom(buf + ret, len - ret, 0);
+ }
pthread_mutexattr_destroy(&attr);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 8 months