root/threadlist.h
/* [<][>][^][v][top][bottom][index][help] */
1 /****************************************************************************
2 * Copyright (C) 2006-2012 by Jason Ansel, Kapil Arya, and Gene Cooperman *
3 * jansel@csail.mit.edu, kapil@ccs.neu.edu, gene@ccs.neu.edu *
4 * *
5 * This file is part of DMTCP. *
6 * *
7 * DMTCP is free software: you can redistribute it and/or *
8 * modify it under the terms of the GNU Lesser General Public License as *
9 * published by the Free Software Foundation, either version 3 of the *
10 * License, or (at your option) any later version. *
11 * *
12 * DMTCP is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU Lesser General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with DMTCP:dmtcp/src. If not, see *
19 * <http://www.gnu.org/licenses/>. *
20 ****************************************************************************/
21
22 #ifndef THREADLIST_H
23 #define THREADLIST_H
24
25 #include <ucontext.h>
26 #include <signal.h>
27 #include <sys/types.h>
28 #include "threadinfo.h"
29
30 namespace dmtcp
31 {
32 namespace ThreadList {
33 pid_t _real_pid();
34 pid_t _real_tid();
35 int _real_tgkill(pid_t tgid, pid_t tid, int sig);
36
37 void init();
38 void initThread(Thread* th, int (*fn)(void*), void *arg, int flags,
39 int *ptid, int *ctid);
40 void updateTid(Thread *);
41 void resetOnFork();
42 void killCkpthread();
43 void threadExit();
44
45 Thread *getNewThread();
46 void addToActiveList();
47 void threadIsDead (Thread *thread);
48 void emptyFreeList();
49
50 void suspendThreads();
51 void resumeThreads();
52 void waitForAllRestored(Thread *thisthread);
53 void postRestart();
54
55 };
56 };
57 #endif