… | … | ||
---|---|---|---|
135 | 135 | ||
136 | =cut | 136 | =cut |
137 | 137 | ||
138 | sub guard { | 138 | sub guard { |
139 | &down; | 139 | &down; |
140 | # double indirection because bless works on the referenced | ||
141 | # object, not (just) on the reference itself. | ||
142 | bless [$_[0]], Coro::Semaphore::guard:: | 140 | bless [$_[0]], Coro::Semaphore::guard:: |
143 | } | 141 | } |
144 | 142 | ||
145 | #=item $guard = $sem->timed_guard ($timeout) | 143 | #=item $guard = $sem->timed_guard ($timeout) |
146 | # | 144 | # |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |