Skip to content

Commit

Permalink
coccinelle: mini_lock: improve performance
Browse files Browse the repository at this point in the history
Replace <+... ...+> by ... when any.  <+... ...+> is slow, and in some
obscure cases involving backward jumps it doesn't force the unlock to
actually come after the end of the if.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
JuliaLawall authored and masahir0y committed May 22, 2018
1 parent 4c1d9bb commit 32d0572
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/coccinelle/locks/mini_lock.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ identifier lock,unlock;
@@

*lock(E1@p,...);
<+... when != E1
... when != E1
when any
if (...) {
... when != E1
* return@r ...;
}
...+>
... when != E1
when any
*unlock@up(E1,...);

@script:python depends on org@
Expand Down

0 comments on commit 32d0572

Please sign in to comment.