Changeset 118 in flair-src for trunk/lib


Ignore:
Timestamp:
Nov 17, 2016, 11:57:29 AM (8 years ago)
Author:
Sanahuja Guillaume
Message:

aded semaphore
resolved bug for rt_printf before thread is started

Location:
trunk/lib/FlairCore/src
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/FrameworkManager_impl.cpp

    r67 r118  
    3737#ifdef __XENO__
    3838#include <native/task.h>
     39#include <rtdk.h>
    3940#endif
    4041
     
    119120  sa.sa_flags = SA_SIGINFO;
    120121  sigaction(SIGDEBUG, &sa, NULL);
    121 #else
     122#else //SIGDEBUG
    122123  signal(SIGXCPU, warn_upon_switch);
    123 #endif
    124 
     124#endif //SIGDEBUG
    125125  string task_name = "Framework_" + name;
     126
     127  // Perform auto-init of rt_print buffers if the task doesn't do so
     128  rt_print_auto_init(1);
     129  // Initialise the rt_print buffer for this task explicitly
     130  rt_print_init(512, task_name.c_str());
     131
    126132  int status = rt_task_shadow(NULL, task_name.c_str(), 10, 0);
    127133  if (status != 0) {
  • trunk/lib/FlairCore/src/Thread_impl.cpp

    r38 r118  
    2626#ifdef __XENO__
    2727#include <rtdk.h>
    28 #else
     28#define TH_NAME getFrameworkManager()->ObjectName() + "-" + self->ObjectName()
     29#else//__XENO__
    2930#include <sys/resource.h>
    3031#include <unistd.h>
    3132#include <sys/syscall.h>
    32 #endif
     33#endif//__XENO__
    3334
    3435using std::string;
     
    6162  last = 0;
    6263  cpt = 0;
     64
     65#ifdef __XENO__
     66  // Perform auto-init of rt_print buffers if the task doesn't do so
     67  rt_print_auto_init(1);
     68    // Initialise the rt_print buffer for this task explicitly
     69  rt_print_init(512, (TH_NAME).c_str());
     70#endif //__XENO__
    6371}
    6472
     
    7684
    7785#ifdef __XENO__
    78   string th_name =
    79       getFrameworkManager()->ObjectName() + "-" + self->ObjectName();
     86  string th_name =TH_NAME;
    8087
    8188#ifdef RT_STACK_SIZE
     
    99106  }
    100107
    101   // Initialise the rt_print buffer for this task explicitly
    102   rt_print_init(512, th_name.c_str());
    103 
    104108#else //__XENO__
    105109
     
    146150void Thread_impl::main_rt(void *arg) {
    147151  Thread_impl *caller = (Thread_impl *)arg;
    148 
    149   // Perform auto-init of rt_print buffers if the task doesn't do so
    150   rt_print_auto_init(1);
    151152
    152153  caller->self->Run();
Note: See TracChangeset for help on using the changeset viewer.