/**
 * DevExtreme (cjs/ui/scheduler/semaphore.js)
 * Version: 21.2.0 (build 21200-0321)
 * Build date: Mon Jul 19 2021
 *
 * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
exports.default = void 0;
var Semaphore = function() {
    function Semaphore() {
        this.counter = 0
    }
    var _proto = Semaphore.prototype;
    _proto.isFree = function() {
        return 0 === this.counter
    };
    _proto.take = function() {
        this.counter++
    };
    _proto.release = function() {
        this.counter--;
        if (this.counter < 0) {
            this.counter = 0
        }
    };
    return Semaphore
}();
exports.default = Semaphore;
module.exports = exports.default;
module.exports.default = exports.default;
