# File lib/uuid.rb, line 270 270: def next_sequence 271: if self.class.state_file 272: open_lock 'rb+' do |io| 273: @mac, @sequence, @last_clock = read_state(io) 274: 275: io.rewind 276: io.truncate 0 277: 278: @sequence += 1 279: 280: write_state io 281: end 282: else 283: @sequence += 1 284: end 285: rescue Errno::ENOENT 286: open_lock 'w' do |io| 287: write_state io 288: end 289: ensure 290: @last_clock = (Time.now.to_f * CLOCK_MULTIPLIER).to_i 291: @drift = 0 292: end