def __init(self): self.hasComponents = condition(self) self.storage = [] self.queue = []
def __init__(self, size=1): super().__init__() self.ok2write = condition(self) self.ok2read = condition(self) self.buf = [] self.size = size
def __init__(self, initial_weight): super().__init__() # invariant: sum(P(w)) - sum(V(w)) >= initial_weight self.weight = initial_weight self.inside_weights = [] self.invariant = condition(self)
def __init__(self): super().__init__() self.same_number = condition(self) self.buf = Queue(-1) self.n_r = 0 self.n_w = 0
def __init__(self): super().__init__() self.ok2read = condition(self) self.waitingReaders = 0 self.buffer = []