[cmake-developers] New command 'file(LOCK_DIRECTORY ...)'

Ruslan Baratov ruslan_baratov at yahoo.com
Tue Oct 7 02:49:21 EDT 2014


On 06-Oct-14 16:54, Brad King wrote:
> On 10/05/2014 04:59 PM, Ruslan Baratov via cmake-developers wrote:
>> So it can't be resolved without some low-level management. I'm thinking
>> about `file` command sub-option like LOCK_DIRECTORY:
>> `file(LOCK_DIRECTORY "/path/to/shared-dir")`. Does it sounds doable?
> I think it is a reasonable proposal.  However, more design is needed
> here, including at least the following items:
>
> * There needs to be a way to define the scope of the lock other than
>    "until cmake exits".  For example, "until current function exits".
>
> * There needs to be a way to explicitly unlock early, or

> to explicitly release management of the lock (e.g. to pass to some other process).
How it will looks like in terms of CMake code?
>
> * The implementation on Windows needs to be handled carefully.
>    The "safe" way to delete a file there is to open it with a handle
>    that is marked as delete-on-close, and then close the handle.
>    That way the file is eventually deleted even if other processes
>    currently have it open/locked.  I don't know if there is an
>    equivalent for a directory.
>
> Thanks,
> -Brad
>




More information about the cmake-developers mailing list