Changeset 23708


Ignore:
Timestamp:
2010-10-29T16:53:16+02:00 (7 years ago)
Author:
mb
Message:

Add macro for locking of recipe commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/rules.mk

    r23598 r23708  
    250250endef 
    251251 
     252# Execute commands under flock 
     253# $(1) => The shell expression. 
     254# $(2) => The lock name. If not given, the global lock will be used. 
     255# $(3) => The filedescriptor used for the lock. Defaults to 1023. 
     256define locked 
     257    ( $(STAGING_DIR_HOST)/bin/flock -x $(if $(3),$(3),1023) && \ 
     258      $(1) \ 
     259    ) $(if $(3),$(strip $(3)),1023)>$(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock 
     260endef 
     261 
    252262# file extension 
    253263ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1))) 
Note: See TracChangeset for help on using the changeset viewer.