"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.reserve_ = exports.reserve = void 0
const core_1 = require("../Managed/core")
const use_1 = require("../Managed/use")
/**
 * Acquires a resource, uses the resource, and then releases the resource.
 * However, unlike `bracket`, the separation of these phases allows
 * the acquisition to be interruptible.
 *
 * Useful for concurrent data structures and other cases where the
 * 'deallocator' can tell if the allocation succeeded or not just by
 * inspecting internal / external state.
 *
 * @dataFirst reserve_
 */
function reserve(use, __trace) {
  return (reservation) => reserve_(reservation, use, __trace)
}
exports.reserve = reserve
/**
 * Acquires a resource, uses the resource, and then releases the resource.
 * However, unlike `bracket`, the separation of these phases allows
 * the acquisition to be interruptible.
 *
 * Useful for concurrent data structures and other cases where the
 * 'deallocator' can tell if the allocation succeeded or not just by
 * inspecting internal / external state.
 */
function reserve_(reservation, use, __trace) {
  return (0, use_1.use_)((0, core_1.makeReserve)(reservation), use, __trace)
}
exports.reserve_ = reserve_
//# sourceMappingURL=reserve.js.map
