Various C++ Examples (including IPC)
Version: 1.0.0
|
slightly complex pthread example More...
#include <iostream>
#include <string>
#include <pthread.h>
Go to the source code of this file.
Classes | |
struct | func_params |
wrapper function parameters/arguments More... | |
Functions | |
void * | myfunc (void *arg) |
user defined function More... | |
void * | func (void *arg) |
A wrapper function for the user defined function. More... | |
int | main (int argc, char *argv[]) |
slightly complex pthread example
This program is slightly more complicated than threadDeath1.cc because we are passing around additional parameters.
The intention here is that we want to demonstrate passing pointers around when creating threads and then accessing those pointers as we go allong.
Definition in file threadDeath2.cc.
void* func | ( | void * | arg | ) |
A wrapper function for the user defined function.
arg | is a void pointer that is expected to point to a func_params object. |
Definition at line 54 of file threadDeath2.cc.
References func_params::argument, func_params::other_info, and func_params::user_func.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 86 of file threadDeath2.cc.
References func_params::argument, func(), myfunc(), func_params::other_info, and func_params::user_func.
void* myfunc | ( | void * | arg | ) |
user defined function
arg | is a string object pointer passed in as a void * |
Definition at line 149 of file threadDeath2.cc.
Referenced by main().