Last change
on this file since 3846 was 3320, checked in by Bruno Cornec, 10 years ago |
- Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in
the move to 3.0
|
-
Property svn:executable
set to
*
|
File size:
577 bytes
|
Line | |
---|
1 | trap "echo got signal" USR1
|
---|
2 |
|
---|
3 | for try in 1 2 3 4 5; do
|
---|
4 | kill -USR1 $$
|
---|
5 | sleep 0.2
|
---|
6 | echo "sent $try signal"
|
---|
7 | done &
|
---|
8 |
|
---|
9 | # Ensure "wait" has something to wait for
|
---|
10 | sleep 2 &
|
---|
11 |
|
---|
12 | # Ensure we do not execute "trap" below before "kill -USR1" above
|
---|
13 | # (was getting failure on loaded machine without this)
|
---|
14 | sleep 0.1
|
---|
15 |
|
---|
16 | sleeping=true
|
---|
17 | while $sleeping; do
|
---|
18 | trap
|
---|
19 | if wait %%; then
|
---|
20 | echo "sleep completed"
|
---|
21 | sleeping=false
|
---|
22 | elif [ $? == 127 ]; then
|
---|
23 | echo "BUG: no processes to wait for?!"
|
---|
24 | sleeping=false
|
---|
25 | else
|
---|
26 | echo "wait interrupted"
|
---|
27 | fi
|
---|
28 | done
|
---|
Note:
See
TracBrowser
for help on using the repository browser.