Logo Search packages:      
Sourcecode: cairo-dock version File versions

void cairo_dock_launch_measure ( CairoDockMeasure *  pMeasureTimer  ) 

Lance les mesures periodiques, prealablement preparee avec cairo_dock_new_measure_timer. La 1ere iteration est executee immediatement. L'acquisition et la lecture des donnees est faite de maniere asynchrone (dans un thread secondaire), alors que le chargement des mesures se fait dans la boucle principale. La frequence est remise a son etat normal.

Parameters:
pMeasureTimer la mesure periodique.

Definition at line 386 of file cairo-dock-applet-facility.c.

{
      g_return_if_fail (pMeasureTimer != NULL);
      if (g_atomic_int_compare_and_exchange (&pMeasureTimer->iThreadIsRunning, 0, 1))  // il etait egal a 0, on lui met 1 et on lance le thread.
      {
            cd_debug (" ==> lancement du thread de calcul");
            
            if (pMeasureTimer->iSidTimerRedraw == 0)
                  pMeasureTimer->iSidTimerRedraw = g_timeout_add (333, (GSourceFunc) _cairo_dock_check_for_redraw, pMeasureTimer);
            
            GError *erreur = NULL;
            GThread* pThread = g_thread_create ((GThreadFunc) _cairo_dock_threaded_calculation, pMeasureTimer, FALSE, &erreur);
            if (erreur != NULL)
            {
                  cd_warning ("Attention : %s", erreur->message);
                  g_error_free (erreur);
            }
      }
      else if (pMeasureTimer->iSidTimer == 0)
      {
            pMeasureTimer->iFrequencyState = CAIRO_DOCK_FREQUENCY_NORMAL;
            pMeasureTimer->iSidTimer = g_timeout_add (pMeasureTimer->iCheckInterval, (GSourceFunc) _cairo_dock_timer, pMeasureTimer);
      }
}


Generated by  Doxygen 1.6.0   Back to index