[pmwiki-users] Re function Lock($op)

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 23 13:55:26 CDT 2008

On Wed, Apr 23, 2008 at 11:51:10AM -0400, Henrik Bechmann wrote:
> In Lock($op), I take it that the following statement blocks, ie *waits* 
> until successful, thus effectively creating a queue to write to files? True?
> flock($lockfp,LOCK_EX);


> I want to write a simple counter generator, with counters incrementing 
> in a file, so I need to prevent mult-user concurrent access.

That's the purpose of PmWiki's Lock() function -- it makes certain
that only one PmWiki process has the lock at any one time for operations
that may change the state of the wiki (e.g., editing or saving pages).


More information about the pmwiki-users mailing list