Fix wait for sleep() when exit
This commit is contained in:
parent
b472a08490
commit
c7824780fa
10
src/wmfs.c
10
src/wmfs.c
@ -137,25 +137,22 @@ thread_process(void *arg)
|
|||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
/* X event loop */
|
/* X event loop */
|
||||||
if(!(int*)arg)
|
if(arg)
|
||||||
{
|
{
|
||||||
while(!exiting && !XNextEvent(dpy, &ev))
|
while(!exiting && !XNextEvent(dpy, &ev))
|
||||||
getevent(ev);
|
getevent(ev);
|
||||||
|
|
||||||
pthread_exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Status checking loop with timing */
|
/* Status checking loop with timing */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
pthread_detach(pthread_self());
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
spawn(conf.status_path);
|
spawn(conf.status_path);
|
||||||
sleep(conf.status_timing);
|
sleep(conf.status_timing);
|
||||||
} while (!exiting && conf.status_timing != 0);
|
} while (!exiting && conf.status_timing != 0);
|
||||||
|
|
||||||
pthread_exit(0);
|
|
||||||
}
|
}
|
||||||
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** WMFS main loop.
|
/** WMFS main loop.
|
||||||
@ -176,7 +173,6 @@ mainloop(void)
|
|||||||
pthread_create(&evstatus, NULL, thread_process, NULL);
|
pthread_create(&evstatus, NULL, thread_process, NULL);
|
||||||
|
|
||||||
(void)pthread_join(evloop, &ret);
|
(void)pthread_join(evloop, &ret);
|
||||||
(void)pthread_join(evstatus, &ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user