The pthread_timedjoin_np() function performs a join-with-timeout. If thread has not yet terminated, then the call blocks until a maximum time, specified in
abstime. If the timeout expires before thread terminates, the call returns an error. The abstime argument is a structure of the following form, specifying
an absolute time measured since the Epoch (see time(2)):
struct timespec {
time_t tv_sec/* seconds */
long tv_nsec /* nanoseconds */
}
判断进程是否存在。示例:
timer=20 #20s定时器flag=1 #标识进程是否存在
while [ $timer -gt 0 ]
do
sleep 2
ps -aux | grep 进程名 | grep -v grep >/dev/null #查询进程
[ $? -ne 0 ] && flag=0 && break #进程不存在了就退出循环
let timer-=1
done
[ $flag -eq 1 ] && kill -9 $(ps -aux | awk '/ bash$/{print $1}')
网络出现异常。根据查询相关公开信息显示,网络出现异常,导致linux系统消息耗时过长,linux系统出现卡顿,导致消息耗时过长。
线程(英语:thread)是 *** 作系统能够进行运算调度的最小单位。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)