Sha256: f1b781a0028f9654800aba78d21103c9c934ae1bca1b7b05a7b280a3f76351eb

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

module Wiris
    class FileLock

        TIMEOUT= 5000
        WAIT = 100

        def file
            @file
        end

        def initialize(file)
            @file = file
        end

        def self.getLock(filename, remaining = 0)
            # Time in milliseconds
            starwait = (Time.now.to_f*1000).to_i
            file = File.new(filename + ".lock", "w+")
            return FileLock.new(file)
        end

        def release()
            file.close
            File.delete(file)
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wirispluginengine-3.62.0.1322 lib/src-generic/FileLock.rb