aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/exit-getpid.ch
blob: e2580ac77e38f8460b3bc68cbed606a149076935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Implement threadexitsall by sending a signal to every proc.
 *
 * To be included from another C file (e.g., Linux-clone.c).
 */

void
_threadexitallproc(char *exitstr)
{
	Proc *p;
	int mypid;

	mypid = getpid();
	lock(&_threadpq.lock);
	for(p=_threadpq.head; p; p=p->next)
		if(p->pid > 1 && p->pid != mypid)
			kill(p->pid, SIGUSR2);
	exits(exitstr);
}

void
_threadexitproc(char *exitstr)
{
	_exits(exitstr);
}