Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
3c2baf0f
Commit
3c2baf0f
authored
17 years ago
by
Mattijs Janssens
Browse files
Options
Downloads
Patches
Plain Diff
Replaced usleep with lockfile
parent
4b5809ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wmake/wmakeScheduler
+5
-9
5 additions, 9 deletions
wmake/wmakeScheduler
with
5 additions
and
9 deletions
wmake/wmakeScheduler
+
5
−
9
View file @
3c2baf0f
...
...
@@ -145,9 +145,6 @@ colourIndex=0
while
:
do
# 0.5 sec
usleep 500000
for
slotGroup
in
$WM_HOSTS
do
# split 'host:N', but catch 'host:' and 'host' too
...
...
@@ -159,11 +156,8 @@ do
i
=
0
while
[
"
$i
"
-lt
"
$n
"
]
do
lock
=
"
$host
:
$i
"
if
[
!
-f
"
$lockDir
/
$lock
"
]
;
then
# Set lock
touch
"
$lockDir
/
$lock
"
lockFile
=
"
$lockDir
/
$host
:
$i
"
if
lockfile
-r0
"
$lockFile
"
2>/dev/null
;
then
# Set colour
colour
=
${
colours
[
$colourIndex
]
}
#echo "** host=$host colourIndex=$colourIndex colour=$colour"
...
...
@@ -186,7 +180,7 @@ do
retval
=
$?
# Release lock
rm
-f
"
$lock
Dir
/
$lock
"
2>/dev/null
rm
-f
"
$lock
File
"
2>/dev/null
exit
$retval
fi
i
=
$(
expr
$i
+ 1
)
...
...
@@ -198,6 +192,8 @@ do
fi
done
done
# Not found any free slots. Rest a bit.
sleep
1
done
if
[
"
$WM_COLOURS
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment