MDAT  1.0
 All Classes Files Functions Variables Typedefs Pages
mdat.h
Go to the documentation of this file.
1 
8 /* Copyright (C) 2013 Eric Larson and Rochelle Palting
9  elarson@seattleu.edu
10 
11  This file is part of the MDAT infrastructure.
12 
13  This program is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #ifndef MDAT_H
28 #define MDAT_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <semaphore.h>
35 #include <pthread.h>
36 
43 typedef const char *(*CheckerFuncPtr)(int, const char *, const char *);
44 
45 // ************************
46 // INITIALIZATION FUNCTIONS
47 // ************************
48 
67 void mdat_init(int numThreads, char *traceName, CheckerFuncPtr checkerFunc,
68  int useInteractive, int useSeed, unsigned int seed);
69 
70 // ****************
71 // THREAD FUNCTIONS
72 // ****************
73 
88 void mdat_thread_start(int id, const char *property);
89 
97 void mdat_thread_finish();
98 
113 void mdat_invoke_scheduler(int location);
114 
115 // **************
116 // LOCK FUNCTIONS
117 // **************
118 
128 void mdat_mutex_init(const char *name, pthread_mutex_t *lock,
129  pthread_mutexattr_t *attr);
130 
139 void mdat_mutex_lock(pthread_mutex_t *lock);
140 
150 void mdat_mutex_unlock(pthread_mutex_t *lock);
151 
152 // *******************
153 // SEMAPHORE FUNCTIONS
154 // *******************
155 
166 void mdat_sem_init(const char *name, sem_t *sem, int pshared, int value);
167 
176 void mdat_sem_wait(sem_t *sem);
177 
186 void mdat_sem_post(sem_t *sem);
187 
188 // *****************
189 // SECTION FUNCTIONS
190 // *****************
191 
204 void mdat_enter_section(const char *section);
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif
This is a personal WEB site developed and maintained by an individual and not by Seattle University. The content and link(s) provided on this site do not represent or reflect the view(s) of Seattle University. The individual who authored this site is solely responsible for the site's content. This site and its author are subject to applicable University policies including the Computer Acceptable Use Policy (www.seattleu.edu/policies).