Arthur Brandao 6 rokov pred
rodič
commit
827fa3546b
1 zmenil súbory, kde vykonal 12 pridanie a 1 odobranie
  1. 12 1
      Serveur/handler.c

+ 12 - 1
Serveur/handler.c

@@ -20,7 +20,11 @@ extern Game game[MAXGAME];
 extern int nbGame;
 
 /* --- Fonctions privées --- */
-
+/**
+ * Thread d'attente de la fonction timer
+ * @param void* La structure timer_data cast en void*
+ * @return NULL
+ */
 void* timer_thread(void* data){
     timer_data* t;
     //Recup données
@@ -39,6 +43,13 @@ void* timer_thread(void* data){
     return NULL;
 }
 
+/**
+ * Attend X second (sans bloquer l'execution) avant d'executer le callback
+ * @param int Nombre de second en attente
+ * @param int Index de la game
+ * @param int Index du joueur dans la game
+ * @param int(*)(Game*, int) Le callback
+ */
 void timer(int second, int game, int player, int(*callback)(Game*, int)){
     pthread_t thread;
     timer_data* t = malloc(sizeof(timer_t));