UNPKG

veffect

Version:

powerful TypeScript validation library built on the robust foundation of Effect combining exceptional type safety, high performance, and developer experience. Taking inspiration from Effect's functional principles, VEffect delivers a balanced approach tha

173 lines (172 loc) 5.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeLocks = exports.writeLocked = exports.writeLock = exports.withWriteLock = exports.withReadLock = exports.withLock = exports.releaseWrite = exports.releaseRead = exports.readLocks = exports.readLocked = exports.readLock = exports.make = exports.locked = exports.lock = exports.fiberWriteLocks = exports.fiberReadLocks = exports.acquireWrite = exports.acquireRead = exports.TReentrantLockTypeId = void 0; var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/stm/tReentrantLock.js")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** * @since 2.0.0 * @category symbols */ const TReentrantLockTypeId = exports.TReentrantLockTypeId = internal.TReentrantLockTypeId; /** * Acquires a read lock. The transaction will suspend until no other fiber is * holding a write lock. Succeeds with the number of read locks held by this * fiber. * * @since 2.0.0 * @category mutations */ const acquireRead = exports.acquireRead = internal.acquireRead; /** * Acquires a write lock. The transaction will suspend until no other fibers * are holding read or write locks. Succeeds with the number of write locks * held by this fiber. * * @since 2.0.0 * @category mutations */ const acquireWrite = exports.acquireWrite = internal.acquireWrite; /** * Retrieves the number of acquired read locks for this fiber. * * @since 2.0.0 * @category mutations */ const fiberReadLocks = exports.fiberReadLocks = internal.fiberReadLocks; /** * Retrieves the number of acquired write locks for this fiber. * * @since 2.0.0 * @category mutations */ const fiberWriteLocks = exports.fiberWriteLocks = internal.fiberWriteLocks; /** * Just a convenience method for applications that only need reentrant locks, * without needing a distinction between readers / writers. * * See `TReentrantLock.writeLock`. * * @since 2.0.0 * @category mutations */ const lock = exports.lock = internal.lock; /** * Determines if any fiber has a read or write lock. * * @since 2.0.0 * @category mutations */ const locked = exports.locked = internal.locked; /** * Makes a new reentrant read/write lock. * * @since 2.0.0 * @category constructors */ const make = exports.make = internal.make; /** * Obtains a read lock in a scoped context. * * @since 2.0.0 * @category mutations */ const readLock = exports.readLock = internal.readLock; /** * Retrieves the total number of acquired read locks. * * @since 2.0.0 * @category mutations */ const readLocks = exports.readLocks = internal.readLocks; /** * Determines if any fiber has a read lock. * * @since 2.0.0 * @category mutations */ const readLocked = exports.readLocked = internal.readLocked; /** * Releases a read lock held by this fiber. Succeeds with the outstanding * number of read locks held by this fiber. * * @since 2.0.0 * @category mutations */ const releaseRead = exports.releaseRead = internal.releaseRead; /** * Releases a write lock held by this fiber. Succeeds with the outstanding * number of write locks held by this fiber. * * @since 2.0.0 * @category mutations */ const releaseWrite = exports.releaseWrite = internal.releaseWrite; /** * Runs the specified workflow with a lock. * * @since 2.0.0 * @category mutations */ const withLock = exports.withLock = internal.withLock; /** * Runs the specified workflow with a read lock. * * @since 2.0.0 * @category mutations */ const withReadLock = exports.withReadLock = internal.withReadLock; /** * Runs the specified workflow with a write lock. * * @since 2.0.0 * @category mutations */ const withWriteLock = exports.withWriteLock = internal.withWriteLock; /** * Obtains a write lock in a scoped context. * * @since 2.0.0 * @category mutations */ const writeLock = exports.writeLock = internal.writeLock; /** * Determines if a write lock is held by some fiber. * * @since 2.0.0 * @category mutations */ const writeLocked = exports.writeLocked = internal.writeLocked; /** * Computes the number of write locks held by fibers. * * @since 2.0.0 * @category mutations */ const writeLocks = exports.writeLocks = internal.writeLocks; //# sourceMappingURL=TReentrantLock.js.map