Esempio n. 1
0
 def __init(self):
     self.hasComponents = condition(self)
     self.storage = []
     self.queue = []
Esempio n. 2
0
 def __init__(self, size=1):
     super().__init__()
     self.ok2write = condition(self)
     self.ok2read = condition(self)
     self.buf = []
     self.size = size
Esempio n. 3
0
 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)
Esempio n. 4
0
 def __init__(self):
     super().__init__()
     self.same_number = condition(self)
     self.buf = Queue(-1)
     self.n_r = 0
     self.n_w = 0
Esempio n. 5
0
 def __init__(self):
     super().__init__()
     self.ok2read = condition(self)
     self.waitingReaders = 0
     self.buffer = []