Make locks objects that auto-release during garbage collection

Created on 3 February 2013, almost 12 years ago
Updated 16 January 2025, 5 days ago

Let's make the lock API more OO and more similar to the way database transactions are handled, like this:
The return value from lock()->acquire() should be an object with $lock->renew() and $lock->release() methods. If a lock object goes out of scope, it is automatically released.

This eliminates the need for the shutdown function and the lock()->releaseAll() method called from the shutdown function.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

lock system

Created by

πŸ‡©πŸ‡°Denmark c960657

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for 8+ years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024