|
PaCO++
0.05
|
#include <paco_omni.h>


Public Member Functions | |
| paco_condition * | paco_create_condition (paco_mutex *mutex) |
| paco_mutex * | paco_create_mutex () |
| paco_thread * | paco_create_thread (void *(*fn)(void *), void *arg=NULL) |
| paco_thread * | paco_create_thread (void(*fn)(void *), void *arg=NULL) |
Definition at line 39 of file paco_omni.h.
| paco_condition * paco_omni_fabrique::paco_create_condition | ( | paco_mutex * | mutex | ) | [virtual] |
Implements paco_fabrique_thread.
Definition at line 60 of file paco_omni.cc.
{
return new paco_omni_condition((paco_omni_mutex*) mutex);
}
| paco_mutex * paco_omni_fabrique::paco_create_mutex | ( | ) | [virtual] |
Implements paco_fabrique_thread.
Definition at line 55 of file paco_omni.cc.
{
return new paco_omni_mutex();
}
| paco_thread * paco_omni_fabrique::paco_create_thread | ( | void *(*)(void *) | fn, |
| void * | arg = NULL |
||
| ) | [virtual] |
Implements paco_fabrique_thread.
Definition at line 65 of file paco_omni.cc.
{
// paco_omni_thread * th = new paco_omni_thread();
// to have a detached thread !
void (*fn_detached)(void*) = (void (*)(void *))fn;
//th->thread = omni_thread::create(fn_detached,arg);
try
{
omni_thread::create(fn_detached,arg);
}
catch (omni_thread_fatal &e)
{
int end = 0;
while (end != 1)
{
cerr << "paco_create_thread error : " << e.error << endl;
end = end + 1;
omni_thread::sleep(2);
try
{
omni_thread::create(fn_detached,arg);
}
catch (omni_thread_fatal &e)
{
end = end - 1;
}
}
}
//return th;
return NULL;
}
| paco_thread * paco_omni_fabrique::paco_create_thread | ( | void(*)(void *) | fn, |
| void * | arg = NULL |
||
| ) | [virtual] |
Implements paco_fabrique_thread.
Definition at line 97 of file paco_omni.cc.
{
try
{
omni_thread::create(fn,arg);
}
catch (omni_thread_fatal &e)
{
int end = 0;
while (end != 1)
{
cerr << "paco_create_thread error : " << e.error << endl;
end = end + 1;
omni_thread::sleep(2);
try
{
omni_thread::create(fn,arg);
}
catch (omni_thread_fatal &e)
{
end = end - 1;
}
}
}
return NULL;
}