projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84f1a0f
)
Allow simulation mode to be terminated before completion
author
Dave West
<davew@uncensored.citadel.org>
Mon, 2 Nov 2009 14:01:47 +0000
(14:01 +0000)
committer
Dave West
<davew@uncensored.citadel.org>
Mon, 2 Nov 2009 14:01:47 +0000
(14:01 +0000)
citadel/threads.c
patch
|
blob
|
history
diff --git
a/citadel/threads.c
b/citadel/threads.c
index aa6636e0aa3c720a2a7d173ed57884a455c4c33e..5f4de7bbdd85ac8b28ba5a49cdf635be8a331de4 100644
(file)
--- a/
citadel/threads.c
+++ b/
citadel/threads.c
@@
-1238,6
+1238,7
@@
void *simulation_worker (void*arg) {
struct CitContext *this;
this = CreateNewContext();
struct CitContext *this;
this = CreateNewContext();
+ CtdlThreadSleep(1);
this->kill_me = 1;
this->state = CON_IDLE;
dead_session_purge(1);
this->kill_me = 1;
this->state = CON_IDLE;
dead_session_purge(1);
@@
-1252,7
+1253,7
@@
void *simulation_thread (void *arg)
{
long stats = statcount;
{
long stats = statcount;
- while(stats) {
+ while(stats
&& !CtdlThreadCheckStop()
) {
CtdlThreadCreate("Connection simulation worker", CTDLTHREAD_BIGSTACK, simulation_worker, NULL);
stats--;
}
CtdlThreadCreate("Connection simulation worker", CTDLTHREAD_BIGSTACK, simulation_worker, NULL);
stats--;
}
@@
-1390,7
+1391,7
@@
void go_threading(void)
#ifdef THREADS_USESIGNALS
if (CtdlThreadGetCount() && CT->state > CTDL_THREAD_STOP_REQ)
#else
#ifdef THREADS_USESIGNALS
if (CtdlThreadGetCount() && CT->state > CTDL_THREAD_STOP_REQ)
#else
- if (CtdlThreadGetCount()
&& !statcount
)
+ if (CtdlThreadGetCount())
#endif
CtdlThreadSleep(1);
}
#endif
CtdlThreadSleep(1);
}