Utilisation thread c++

Fermé
tapharule Messages postés 123 Date d'inscription mercredi 24 septembre 2008 Statut Membre Dernière intervention 24 octobre 2015 - 26 févr. 2011 à 11:58
tapharule Messages postés 123 Date d'inscription mercredi 24 septembre 2008 Statut Membre Dernière intervention 24 octobre 2015 - 26 févr. 2011 à 18:17
Bonjour,

Je suis sous ubuntu (je specifi car l utilisation des threads est differentes sous windows)
voila je demande comment execute un thread en lui specifiant une duree limite en c++.

par exemple j ai cette fonction

pthread_t *thread[5]

void boucleInf()
{
while (1);

}

void utilisationThread(int nbr)
{
// executer la fonction boucleInf() avec une duree d une seconde

QUE DOIJE METTRE ICI ???????????????????????

pthread_create(thread[nb], ???, boucleInf, NULL);

}

int main(int ac, char **av)
{
for (int i = 0; i <10; i++)
{
utilisationThread();
}
return (0);
}


merci

1 réponse

tapharule Messages postés 123 Date d'inscription mercredi 24 septembre 2008 Statut Membre Dernière intervention 24 octobre 2015 8
26 févr. 2011 à 18:17
help!!!!!
0