File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,16 @@ namespace RTC
11
11
{
12
12
hrpExecutionContext::~hrpExecutionContext ()
13
13
{
14
+ if (m_thread_pending)
15
+ abort ();
14
16
}
15
17
int hrpExecutionContext::svc (void )
18
+ {
19
+ int ret = svc_wrapped ();
20
+ m_thread_pending = false ;
21
+ return ret;
22
+ }
23
+ int hrpExecutionContext::svc_wrapped (void )
16
24
{
17
25
if (open_iob () == FALSE ){
18
26
std::cerr << " open_iob: failed to open" << std::endl;
@@ -191,6 +199,12 @@ namespace RTC
191
199
throw OpenHRP::ExecutionProfileService::ExecutionProfileServiceException (" no such component" );
192
200
}
193
201
202
+ void hrpExecutionContext::activate ()
203
+ {
204
+ m_thread_pending = true ;
205
+ PeriodicExecutionContext::activate ();
206
+ }
207
+
194
208
void hrpExecutionContext::resetProfile ()
195
209
{
196
210
m_profile.max_period = m_profile.avg_period = 0 ;
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ namespace RTC
33
33
#else
34
34
: RTC_exp::PeriodicExecutionContext(),
35
35
#endif
36
- m_priority (49 )
36
+ m_priority (49 ),
37
+ m_thread_pending (false )
37
38
{
38
39
resetProfile ();
39
40
rtclog.setName (" hrpEC" );
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ namespace RTC
35
35
#ifdef OPENRTM_VERSION_TRUNK
36
36
virtual void tick (){}
37
37
#endif
38
+ void activate ();
38
39
39
40
OpenHRP::ExecutionProfileService::Profile *getProfile ();
40
41
OpenHRP::ExecutionProfileService::ComponentProfile getComponentProfile (RTC::LightweightRTObject_ptr obj);
@@ -64,10 +65,13 @@ namespace RTC
64
65
}
65
66
fprintf (stderr, " [ms]\n " );
66
67
};
68
+ int svc_wrapped (void );
69
+
67
70
OpenHRP::ExecutionProfileService::Profile m_profile;
68
71
struct timeval m_tv;
69
72
int m_priority;
70
73
std::vector<std::string> rtc_names;
74
+ volatile bool m_thread_pending;
71
75
};
72
76
};
73
77
You can’t perform that action at this time.
0 commit comments