Mercurial > hg > release > heapstats-2.0
changeset 217:911de1085b7c
Bug 3764: Agent thread might not be stopped when it works
Reviewed-by: ykubota
https://github.com/HeapStats/heapstats/pull/151
author | Yasumasa Suenaga <yasuenag@gmail.com> |
---|---|
date | Mon, 11 Nov 2019 17:56:32 +0900 |
parents | 3a15cfb00a39 |
children | 47d7a1492892 |
files | ChangeLog agent/src/heapstats-engines/agentThread.cpp |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Nov 10 00:26:38 2019 +0900 +++ b/ChangeLog Mon Nov 11 17:56:32 2019 +0900 @@ -1,3 +1,7 @@ +2019-11-11 Yasumasa Suenaga <yasuenag@gmail.com> + + * Bug 3764: Agent thread might not be stopped when it works + 2019-11-10 Yasumasa Suenaga <yasuenag@gmail.com> * Bug 3765: pthread mutex lock/unlock enhancement
--- a/agent/src/heapstats-engines/agentThread.cpp Sun Nov 10 00:26:38 2019 +0900 +++ b/agent/src/heapstats-engines/agentThread.cpp Mon Nov 11 17:56:32 2019 +0900 @@ -19,6 +19,8 @@ * */ +#include <sched.h> + #include "globals.hpp" #include "util.hpp" #include "agentThread.hpp" @@ -134,7 +136,7 @@ /* SpinLock for AgentThread termination. */ while (this->_isRunning) { - ; /* none. */ + sched_yield(); } /* Clean termination flag. */