devel:locking
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:locking [2008-08-20 05:03] – 98.203.142.137 | devel:locking [2014-04-20 17:21] (current) – old revision restored (2012/08/05 18:42) 2001:4dd0:ff00:8eb9:2514:1931:19a7:1575 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Page locking ====== | ||
+ | The page locking mechanism is based around a .lock file that temporarily exists within the dokuwiki/ | ||
+ | |||
+ | When a page is edited, a .lock file is created by the [[xref> | ||
+ | |||
+ | The release of a lock is done by deleting the .lock file. This is achieved by the [[xref> | ||
+ | |||
+ | Checking for an existing lock is handled by the [[xref> | ||
+ | |||
+ | Due to current limitations of the design, the [[xref> | ||
+ | |||
+ | The typical program flow: | ||
+ | |||
+ | <code php> | ||
+ | if (!checklock($id)) { | ||
+ | lock($id); | ||
+ | // work | ||
+ | unlock($id); | ||
+ | } else { | ||
+ | // error | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | avoids lock stealing in the typical case, where the attempts to lock a page are few and far between. However, in a scenario of two concurrent processes, where the [[xref> |
devel/locking.txt · Last modified: 2014-04-20 17:21 by 2001:4dd0:ff00:8eb9:2514:1931:19a7:1575