Pack your two arguments into a
struct
and then pass it as the
void *
parameter, for instance (assuming you are using the
Windows API CreateThread
function):
DWORD WINAPI my_fun( LPVOID lpParam );
struct MyArg
{
Mat * p_in;
Mat * p_out;
};
Mat in, out;
MyArg arg;
HANDLE thread_handle;
DWORD thread_id;
arg.p_in = ∈
arg.p_out = &out;
thread_handle = CreateThread( NULL, 0, my_fun, (LPVOID) &arg, 0, &thread_id]);
DWORD WINAPI my_fun( LPVOID lpParam )
{
if ( ! lpParam)
{
}
Mat * p_in, * p_out;
p_in = (( MyArg *)(lpParam))->p_in;
p_out = (( MyArg *)(lpParam))->p_out;
}