Phase 8.3: Fix spawn to use bux_task_spawn for non-async functions
- Added exprSpawnAsync flag to AST ekSpawn - Sema checks if callee is async and sets the flag - HIR hSpawn carries spawnAsync flag - C backend uses bux_task_spawn for non-async (OS threads) and bux_async_spawn for async (coroutines) - Added concurrency example to test suite
This commit is contained in:
@@ -832,6 +832,7 @@ proc lowerExpr(ctx: var LowerCtx, expr: Expr): HirNode =
|
||||
for arg in expr.exprSpawnArgs:
|
||||
args.add(ctx.lowerExpr(arg))
|
||||
return HirNode(kind: hSpawn, spawnCallee: calleeName, spawnArgs: args,
|
||||
spawnAsync: expr.exprSpawnAsync,
|
||||
typ: makePointer(makeVoid()), loc: loc)
|
||||
|
||||
of ekAwait:
|
||||
|
||||
Reference in New Issue
Block a user