Utilisation thread c++

tapharule Messages postés 123 Date d'inscription   Statut Membre Dernière intervention   -  
tapharule Messages postés 123 Date d'inscription   Statut Membre Dernière intervention   -
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   Statut Membre Dernière intervention   8
 
help!!!!!
0