def loadblk(self, blk, buf): tell, wait = c12.tell, c21.wait bufmem = memoryview(buf) # on the first cycle we synchronize with invalidate in T2 if self.cycle == 0: tell('T1-loadblk0-ready') wait('T1-loadblk0-go') # here we know request to invalidate this page came in and this # '1' should be ignored by virtmem bufmem[0] = bord_py3(b'1') # this is code for consequent "after-invalidate" loadblk # '2' should be returned to clients else: bufmem[0] = bord_py3(b'2') self.cycle += 1
def T1(): assert m[0] == bord_py3(b'2')