[m-dev.] for review: file locking

Fergus Henderson fjh at cs.mu.oz.au
Tue Jul 15 16:36:21 AEST 1997


Thomas Charles CONWAY, you wrote:
> library/io.m:
> 	add io__lock_file and io__unlock_file which perform
> 	advisory locking on (open) files.
> 
> NEWS:
> 	mention io__lock_file and io__unlock_file.

That looks fine, except for the following:

> +% File locking predicates (using adivsory locking only)

Fix typo: s/adivsory/advisory/

> +	% Attempt to obtain a lock on a file.
> +	% A file may have multiple shared locks, but only one exclusive
> +	% lock. A file may not have both a shared lock and an exclusive
> +	% lock simultaneously. If the block parameter is set to `block'
> +	% then execution will block until the requested lock becomes
> +	% available.
> +:- pred io__lock_file(io__poly_stream, lock_type, block, io__res(bool),
> +		io__state, io__state).
> +:- mode io__lock_file(in, in, in, out, di, uo) is det.

You need to document the semantics of the `io__res(bool)' argument.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list