Lines Matching +full:sig +full:- +full:dir
38 wd=/tmp/signal.dir
39 rm -rf $wd
40 mkdir -p $wd
65 long lwp_id = thisArg->id;
72 if( pthread_mutex_lock(thisArg->mutex) != 0 ) {
79 if( pthread_mutex_unlock(thisArg->mutex) != 0 ) {
118 arg->id = i;
119 arg->mutex = mutex;
176 printf("Usage: %s <pid> <lwp_id> <sig>\n", argv[0]);
186 int sig;
187 sscanf(argv[3], "%d", &sig);
189 if( syscall(SYS_thr_kill2, pid, id, sig) ) {
196 mycc -o waitthread -Wall -Wextra waitthread.c -lpthread || exit
197 mycc -o tkill -Wall -Wextra tkill.c || exit
198 rm -f waitthread.c tkill.c
200 rm -f gdbfifo gdbout pstat /tmp/waitthread
201 pkill -9 waitthread
202 pgrep -q waitthread && { pgrep waitthread | xargs ps -lHp; exit 1; }
204 trap "rm -f gdbfifo" EXIT INT
209 (trap - INT; gdb ./waitthread < gdbfifo > gdbout 2>&1) &
217 pid=`ps -x | grep -v grep | grep "waitthread 8" |
219 [ -n "$pid" ] && break
223 if [ -n "$pid" ]; then
224 procstat -t $pid > pstat
227 t2=`grep umtxn pstat | awk '{print $2}' | tail -1`
229 set -e
237 grep -q "signal SIGINT" gdbout || { echo FAIL; cat gdbout; s=1; }
243 kill -9 $fifopid $gdbpid > /dev/null 2>&1
244 pgrep -q waitthread && pkill -9 waitthread
246 rm -rf $wd /tmp/waitthread