lock-install.inc

A stub lock implementation to be used during the installation process when database access is not yet available. Because Drupal's install system should never be running in more than on concurrant request, we can bypass any need for locking.

File

drupal-6.x/includes/lock-install.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * A stub lock implementation to be used during the installation
  5. * process when database access is not yet available. Because Drupal's
  6. * install system should never be running in more than on concurrant
  7. * request, we can bypass any need for locking.
  8. */
  9. /**
  10. * Initialize the locking system.
  11. */
  12. function lock_init() {
  13. }
  14. /**
  15. * Acquire (or renew) a lock, but do not block if it fails.
  16. *
  17. * @return
  18. * TRUE if the lock was acquired, FALSE if it failed.
  19. */
  20. function lock_acquire($name, $timeout = 30.0) {
  21. return TRUE;
  22. }
  23. /**
  24. * Check if lock acquired by a different process may be available.
  25. *
  26. * @return
  27. * TRUE if there is no lock or it was removed, FALSE otherwise.
  28. */
  29. function lock_may_be_available($name) {
  30. return TRUE;
  31. }
  32. /**
  33. * Wait for a lock to be available.
  34. *
  35. * @return
  36. * TRUE if the lock holds, FALSE if it is available.
  37. */
  38. function lock_wait($name, $delay = 30) {
  39. return FALSE;
  40. }
  41. /**
  42. * Release a lock previously acquired by lock_acquire().
  43. *
  44. * This will release the named lock if it is still held by the current request.
  45. *
  46. * @param $name
  47. * The name of the lock.
  48. */
  49. function lock_release($name) {
  50. }
  51. /**
  52. * Release all previously acquired locks.
  53. */
  54. function lock_release_all($lock_id = NULL) {
  55. }