aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/csource/csource.go')
-rw-r--r--pkg/csource/csource.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index 68f961526..32e01ff1e 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -115,6 +115,17 @@ func (ctx *context) generateSource() ([]byte, error) {
}
}
replacements["CALL_TIMEOUT_MS"] = timeoutExpr
+ if ctx.p.RequiredFeatures().Async {
+ conditions := []string{}
+ for idx, call := range ctx.p.Calls {
+ if !call.Props.Async {
+ continue
+ }
+ conditions = append(conditions, fmt.Sprintf("call == %v", idx))
+ }
+ replacements["ASYNC_CONDITIONS"] = strings.Join(conditions, " || ")
+ }
+
result, err := createCommonHeader(ctx.p, mmapProg, replacements, ctx.opts)
if err != nil {
return nil, err