Go to the source code of this file.
|
| void * | Master (void *arg) |
| |
| void * | Slave (void *arg) |
| |
| int | main (int argc, char **argv) |
| |
◆ ERROR_RETURN
| #define ERROR_RETURN |
( |
|
retval | ) |
{ fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); } |
◆ LOOPS
◆ SLEEP_VALUE
| #define SLEEP_VALUE 20000 |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 73 of file examples/locks_pthreads.c.
77 int result_m, result_s,
rc,
i;
86 result_m = 2 * result_m -
i;
96 printf(
"Library initialization error! \n");
107 rc = pthread_create(&master, NULL,
Master, NULL);
112 rc = pthread_create(&slave1, NULL,
Slave, NULL);
117 pthread_join(master, NULL);
118 printf(
"Master: Expected: %d Recieved: %d\n", result_m,
count);
119 if (result_m !=
count)
123 pthread_join(slave1, NULL);
124 printf(
"Slave: Expected: %d Recieved: %d\n", result_s,
count);
126 if (result_s !=
count)
unsigned long int pthread_t
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
#define ERROR_RETURN(retval)
int PAPI_set_debug(int level)
◆ Master()
| void* Master |
( |
void * |
arg | ) |
|
Definition at line 21 of file examples/locks_pthreads.c.
24 int *pointer, * pointer2;
52 printf(
"Thread specific data is %d \n", *pointer2);
int PAPI_register_thread(void)
int PAPI_get_thr_specific(int tag, void **ptr)
#define ERROR_RETURN(retval)
int PAPI_set_thr_specific(int tag, void *ptr)
◆ Slave()
| void* Slave |
( |
void * |
arg | ) |
|
◆ count
◆ rank