
 
 
次の例では、SYNC 文が重要な文のセットをロックします。
method-id Withdraw.
procedure division using by value amount as binary-long
                   returning ret as binary-long.
           sync on self
               if balance >= amount
                   display "In critical section"
                   compute balance = balance - amount
                   set ret to amount
               else
                   display "In critical section"
                   set ret to 0
               end-if
           end-sync
end method.