def __init__(self, ring, sequence, nframe, nonblocking=False): SpanBase.__init__(self, ring, sequence, writeable=True) nbyte = nframe * self._sequence.tensor['frame_nbyte'] self.obj = _bf.BFwspan() _check(_bf.bfRingSpanReserve(self.obj, ring.obj, nbyte, nonblocking)) self._set_base_obj(self.obj) # Note: We default to 0 instead of nframe so that we don't accidentally # commit bogus data if a block throws an exception. self.commit_nframe = 0
def __init__(self, ring, size, nonblocking=False): SpanBase.__init__(self, ring, writeable=True) self.obj = _bf.BFwspan() _check(_bf.bfRingSpanReserve(self.obj, ring.obj, size, nonblocking)) self.commit_size = size