PaCO++  0.05
paco_omni_fabrique Class Reference

#include <paco_omni.h>

Inheritance diagram for paco_omni_fabrique:
Inheritance graph
Collaboration diagram for paco_omni_fabrique:
Collaboration graph

Public Member Functions

paco_conditionpaco_create_condition (paco_mutex *mutex)
 
paco_mutexpaco_create_mutex ()
 
paco_threadpaco_create_thread (void *(*fn)(void *), void *arg=NULL)
 
paco_threadpaco_create_thread (void(*fn)(void *), void *arg=NULL)
 

Detailed Description

Definition at line 39 of file paco_omni.h.

Member Function Documentation

◆ paco_create_condition()

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.

61 {
62  return new paco_omni_condition((paco_omni_mutex*) mutex);
63 }

◆ paco_create_mutex()

paco_mutex * paco_omni_fabrique::paco_create_mutex ( )
virtual

Implements paco_fabrique_thread.

Definition at line 55 of file paco_omni.cc.

56 {
57  return new paco_omni_mutex();
58 }

◆ paco_create_thread() [1/2]

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.

66 {
67  // paco_omni_thread * th = new paco_omni_thread();
68  // to have a detached thread !
69  void (*fn_detached)(void*) = (void (*)(void *))fn;
70  //th->thread = omni_thread::create(fn_detached,arg);
71  try
72  {
73  omni_thread::create(fn_detached,arg);
74  }
75  catch (omni_thread_fatal &e)
76  {
77  int end = 0;
78  while (end != 1)
79  {
80  cerr << "paco_create_thread error : " << e.error << endl;
81  end = end + 1;
82  omni_thread::sleep(2);
83  try
84  {
85  omni_thread::create(fn_detached,arg);
86  }
87  catch (omni_thread_fatal &e)
88  {
89  end = end - 1;
90  }
91  }
92  }
93  //return th;
94  return NULL;
95 }

◆ paco_create_thread() [2/2]

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.

98 {
99  try
100  {
101  omni_thread::create(fn,arg);
102  }
103  catch (omni_thread_fatal &e)
104  {
105  int end = 0;
106  while (end != 1)
107  {
108  cerr << "paco_create_thread error : " << e.error << endl;
109  end = end + 1;
110  omni_thread::sleep(2);
111  try
112  {
113  omni_thread::create(fn,arg);
114  }
115  catch (omni_thread_fatal &e)
116  {
117  end = end - 1;
118  }
119  }
120  }
121  return NULL;
122 }

The documentation for this class was generated from the following files: