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). * 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 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
