[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/lock/ -> db.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 153 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

db:: (4 methods):
  __construct()
  acquire()
  owns_lock()
  release()


Class: db  - X-Ref

Database locking class

__construct($config_name, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)   X-Ref
Creates a named released instance of the lock.

You have to call acquire() to actually create the lock.

param: string                                $config_name    A config variable to be used for locking
param: \phpbb\config\config                $config            The phpBB configuration
param: \phpbb\db\driver\driver_interface    $db                A database connection

acquire()   X-Ref
Tries to acquire the lock by updating
the configuration variable in the database.

As a lock may only be held by one process at a time, lock
acquisition may fail if another process is holding the lock
or if another process obtained the lock but never released it.
Locks are forcibly released after a timeout of 1 hour.

return: bool            true if lock was acquired

owns_lock()   X-Ref
Does this process own the lock?

return: bool            true if lock is owned

release()   X-Ref
Releases the lock.

The lock must have been previously obtained, that is, acquire() call
was issued and returned true.

Note: Attempting to release a lock that is already released,
that is, calling release() multiple times, is harmless.

return: null



Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1