summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/rpn/rpn_parse.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/rpn/rpn_parse.go b/internal/rpn/rpn_parse.go
index 2d2963a..7abd41c 100644
--- a/internal/rpn/rpn_parse.go
+++ b/internal/rpn/rpn_parse.go
@@ -367,6 +367,9 @@ func (r *RPN) evaluate(input string, tokens []string) (string, error) {
return result, nil
case "binary":
if i+2 < len(tokens) && tokens[i+2] == "set" {
+ // Lock order: r.mu → o.mu (same as RPN.SetPrefixMode)
+ // No deadlock risk: both paths acquire in the same direction.
+ // r.mu is held by evaluate(); o.mu is a separate mutex on Operations.
r.prefixMode = IEC
r.ops.SetPrefixMode(IEC)
return "prefix mode: IEC", nil