[GRASS-git] [OSGeo/grass] 70bc66: grass.script: Add locking to init (#5591)
Vaclav Petras
noreply at github.com
Sat Apr 26 08:15:36 PDT 2025
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 70bc66dfb9cb3deb25cedf8213b15a62ea2166b1
https://github.com/OSGeo/grass/commit/70bc66dfb9cb3deb25cedf8213b15a62ea2166b1
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2025-04-26 (Sat, 26 Apr 2025)
Changed paths:
M python/grass/app/data.py
M python/grass/script/setup.py
M python/grass/script/tests/grass_script_setup_test.py
Log Message:
-----------
grass.script: Add locking to init (#5591)
The function _gs.setup.init_ can now optionally lock the mapset and unlock when exiting the context or with call to finish (both free function or bound method). This keeps the current state of not locking as a default, i.e., the locking is opt-in, so multiple session are responsibility of the user just like running multiple processes within one mapset.
The PID used is the the current process ID which is already used for variable GIS_LOCK in init. The underlying locking (but not unlocking) functionality is the same one as used for the main _grass_ command thanks to a previous refactoring of locking from lib/init/grass.py to _grass.app.data_.
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list