ensure we use vfork when single-threaded, even if threading is compiled in

This commit is contained in:
Jean-Francois Dockes 2013-03-06 15:21:14 +01:00
parent 466dfc49e2
commit 042a54ef27

View file

@ -124,6 +124,17 @@ RclConfig *recollinit(RclInitFlags flags,
#ifndef IDX_THREADS
ExecCmd::useVfork(true);
#else
bool intern_noThr = config->getThrConf(RclConfig::ThrIntern).first == -1;
bool split_noThr = config->getThrConf(RclConfig::ThrSplit).first == -1;
bool write_noThr = config->getThrConf(RclConfig::ThrDbWrite).first == -1;
if (intern_noThr && split_noThr && write_noThr) {
LOGDEB0(("rclinit: single-threaded execution: use vfork\n"));
ExecCmd::useVfork(true);
} else {
LOGDEB0(("rclinit: multi-threaded execution: do not use vfork\n"));
ExecCmd::useVfork(false);
}
#endif
int flushmb;