Exemplo n.º 1
0
void GenericFunctionInterval::priv_instant()
   {
   check_stopped(get_class_type(), "priv_instant");
   // Evaluate the function
   if(m_functionPtr != NULL)
      {
      // Note: the following code would deadlock when trying to access data from another
      //       running interval (such as in the Boxing-Robots tutorial, i.e. checkPunch
      //       accessing resetHead). I'm guessing it is because the running thread1 is
      //       asking data from thread2 who is waiting for thread1 to finish...
      //
      //       (*m_functionPtr)(m_dataPtr);
      //
      //       The truth is I did not try to figure it out, but I rather looked for a
      //       workaround to indirectly ask data to thread2 using an AsyncTask.
      string taskName("GenericFunctionIntervalTask");
      taskName += InstanceCounter;
      AsyncTaskManager::get_global_ptr()->add(new GenericAsyncTask(taskName, wrapper, this));
      }
   _state = S_final;
   }
Exemplo n.º 2
0
 // Decrement the count of dependent objects
 // Caller must hold the mutex
 void release ()
 {
     if (--m_child_count == 0)
         check_stopped ();
 }
Exemplo n.º 3
0
 void onChildrenStopped ()
 {
     std::lock_guard <decltype(m_mutex)> lock (m_mutex);
     check_stopped ();
 }
Exemplo n.º 4
0
// Decrement the count of dependent objects
// Caller must hold the mutex
void
OverlayImpl::release ()
{
    if (--m_child_count == 0)
        check_stopped ();
}