Commit a504a4ba by Eric Coissac

Rename private functions

parent 218f3800
......@@ -27,11 +27,11 @@ include clobber
LECA_LOCK_DELAY=2
LECA_LOCK_MAXRETRY=0
function lockfile() {
function __lockfile__() {
echo "${LOCK_DIR}/__${1}__.lecalock"
}
function locktag() {
function __locktag__() {
echo "$(hostname).$$"
}
......@@ -46,12 +46,12 @@ function getlock() {
fi
if [[ "${mode}" == "global" ]]; then
name=$(lockfile "${name}")
name=$(__lockfile__ "${name}")
else
name=$(lockfile "${name}.$(whoami)")
name=$(__lockfile__ "${name}.$(whoami)")
fi
local TAG=$(locktag)
local TAG=$(__locktag__)
local retry=0
local notgetlock=1
......@@ -95,12 +95,12 @@ function releaselock() {
fi
if [[ "${mode}" == "global" ]]; then
name=$(lockfile "${name}")
name=$(__lockfile__ "${name}")
else
name=$(lockfile "${name}.$(whoami)")
name=$(__lockfile__ "${name}.$(whoami)")
fi
local TAG=$(locktag)
local TAG=$(__locktag__)
local LOCK=""
if [[ -f "${name}" ]]; then
......@@ -133,7 +133,7 @@ function getsemaphore() {
mode="global"
fi
local TAG=$(locktag)
local TAG=$(__locktag__)
local retry=0
local notgetlock=1
......@@ -143,9 +143,9 @@ function getsemaphore() {
while (( notgetlock > 0 )) && (( i < maxcount )) ; do
if [[ "${mode}" == "global" ]]; then
name=$(lockfile "${semname}.@${i}")
name=$(__lockfile__ "${semname}.@${i}")
else
name=$(lockfile "${semname}.$(whoami).@${i}")
name=$(__lockfile__ "${semname}.$(whoami).@${i}")
fi
pushnoclobber
......@@ -185,9 +185,9 @@ function releasesemaphore() {
fi
if [[ "${mode}" == "global" ]]; then
name=$(lockfile "${name}.@*")
name=$(__lockfile__ "${name}.@*")
else
name=$(lockfile "${name}.$(whoami).@*")
name=$(__lockfile__ "${name}.$(whoami).@*")
fi
toremove=$(ls -tr $name 2> /dev/null | head -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment