mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
Add exec_new_thread
This commit is contained in:
parent
fe7ce9d1b3
commit
0e928c758f
6 changed files with 31 additions and 58 deletions
|
@ -3,9 +3,9 @@ extern crate erg_compiler;
|
|||
extern crate erg_parser;
|
||||
|
||||
use std::process;
|
||||
use std::thread;
|
||||
|
||||
use erg_common::config::ErgConfig;
|
||||
use erg_common::spawn::exec_new_thread;
|
||||
use erg_common::traits::Runnable;
|
||||
|
||||
use erg_compiler::build_hir::HIRBuilder;
|
||||
|
@ -49,17 +49,5 @@ fn run() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
if cfg!(windows) {
|
||||
const STACK_SIZE: usize = 4 * 1024 * 1024;
|
||||
|
||||
let child = thread::Builder::new()
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(run)
|
||||
.unwrap();
|
||||
|
||||
// Wait for thread to join
|
||||
child.join().unwrap();
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
exec_new_thread(run);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue