Either have the two processes send messages to each other, or place the file under a temporary name (in the target directory) first, then move it to its final location. POSIX guarantees that moving a file is an atomic operation.
E.g.
temp=$(mktemp $(dirname $target).XXXXXX)
cp "$source" "$temp"
mv "$temp" "$target"