Skip to content
Snippets Groups Projects

Fix parallel code gen in RT backend

Merged rarbore2 requested to merge fix_task_parallelism into main
2 files
+ 44
7
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 3
6
@@ -594,7 +594,7 @@ impl<'a> RTContext<'a> {
(_, true) => {
write!(block, "{}", self.clone_arc(id).unwrap())?;
format!(
"*async_call_{}.lock().await = Some(::async_std::task::spawn(async move {{ ",
"*async_call_{}.lock().await = ::hercules_rt::__FutureSlotWrapper::new(::async_std::task::spawn(async move {{ ",
id.idx(),
)
}
@@ -1106,7 +1106,7 @@ impl<'a> RTContext<'a> {
if is_async_call {
write!(
w,
"let mut async_call_{} = ::std::sync::Arc::new(::async_std::sync::Mutex::new(None));",
"let mut async_call_{} = ::std::sync::Arc::new(::async_std::sync::Mutex::new(::hercules_rt::__FutureSlotWrapper::empty()));",
idx,
)?;
} else {
@@ -1382,10 +1382,7 @@ impl<'a> RTContext<'a> {
&& func.schedules[id.idx()].contains(&Schedule::AsyncCall)
{
assert!(!lhs);
format!(
"async_call_{}.lock().await.as_mut().unwrap().await",
id.idx(),
)
format!("async_call_{}.lock().await.inspect().await", id.idx(),)
} else {
format!("node_{}", id.idx())
}
Loading