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

Ruslan Baratov ruslan_baratov at yahoo.com
Wed Oct 8 07:52:27 EDT 2014


On 07-Oct-14 16:25, Brad King wrote:
> On 10/07/2014 02:49 AM, Ruslan Baratov wrote:
>> How it will looks like in terms of CMake code?
> That's what I'm asking you to think through and propose ;)
>
> Thanks,
> -Brad
>
Okay :) I just not sure that I understand "to pass to some other 
process" goal correctly.

* we just need to `unlock` file so the other instance will use it:
file(UNLOCK_FILE "/path/to/shared/file")
# now anybody can do the lock

* we need other process to "inherit" the lock (what for?), i.e. move 
ownership (?):
file(LOCK_FILE "/path/to/shared/file")
execute_process(${CMAKE_COMMAND} --take-ownership "/path/to/shared/file" 
...)
# unlocked by execute_process

Ruslo



More information about the cmake-developers mailing list