Include: Fix command line parser hang when threaded.
This commit is contained in:
parent
e4e3294363
commit
b1ab48b9fc
|
|
@ -1678,7 +1678,7 @@ void Verilated::flushCall() VL_MT_SAFE {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Verilated::commandArgs(int argc, const char** argv) VL_MT_SAFE {
|
void Verilated::commandArgs(int argc, const char** argv) VL_MT_SAFE {
|
||||||
VerilatedLockGuard lock(m_mutex);
|
VerilatedLockGuard lock(s_args.m_argMutex);
|
||||||
s_args.argc = argc;
|
s_args.argc = argc;
|
||||||
s_args.argv = argv;
|
s_args.argv = argv;
|
||||||
VerilatedImp::commandArgs(argc,argv);
|
VerilatedImp::commandArgs(argc,argv);
|
||||||
|
|
|
||||||
|
|
@ -347,6 +347,7 @@ class Verilated {
|
||||||
// no need to be save-restored (serialized) the
|
// no need to be save-restored (serialized) the
|
||||||
// assumption is that the restore is allowed to pass different arguments
|
// assumption is that the restore is allowed to pass different arguments
|
||||||
static struct CommandArgValues {
|
static struct CommandArgValues {
|
||||||
|
VerilatedMutex m_argMutex; ///< Mutex for s_args members, when VL_THREADED
|
||||||
int argc;
|
int argc;
|
||||||
const char** argv;
|
const char** argv;
|
||||||
CommandArgValues() : argc(0), argv(NULL) {}
|
CommandArgValues() : argc(0), argv(NULL) {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue