mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
simplify timeout mechanism and fix race conditions there
This commit is contained in:
parent
f3cd7d646d
commit
a76c0fbbfb
2 changed files with 15 additions and 18 deletions
|
@ -115,6 +115,7 @@ void display_usage() {
|
|||
}
|
||||
|
||||
void parse_cmd_line_args(int argc, char ** argv) {
|
||||
long timeout = 0;
|
||||
int i = 1;
|
||||
char * eq_pos = nullptr;
|
||||
while (i < argc) {
|
||||
|
@ -216,8 +217,7 @@ void parse_cmd_line_args(int argc, char ** argv) {
|
|||
else if (strcmp(opt_name, "T") == 0) {
|
||||
if (!opt_arg)
|
||||
error("option argument (-T:timeout) is missing.");
|
||||
long tm = strtol(opt_arg, nullptr, 10);
|
||||
set_timeout(tm * 1000);
|
||||
timeout = strtol(opt_arg, nullptr, 10);
|
||||
}
|
||||
else if (strcmp(opt_name, "t") == 0) {
|
||||
if (!opt_arg)
|
||||
|
@ -292,6 +292,9 @@ void parse_cmd_line_args(int argc, char ** argv) {
|
|||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (timeout)
|
||||
set_timeout(timeout * 1000);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue