4 # * Copyright 2010 Martin Quinson, Mehdi Fekari
5 # * All right reserved.
7 # * This program is free software; you can redistribute
8 # * it and/or modify it under the terms of the license
9 # *(GNU LGPL) which comes with this package.
14 Thread.abort_on_exception = true
15 attr_accessor :permits
18 def initialize ( permits )
27 raise "Interrupted Thread " if (!Thread.current.alive?)
35 @permits = @permits - 1