Salut,

J'utilise des threads et je voudrais empêcher le die de tuer mon thread.
Ex :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
my $Thread = threads->create( 
  while (1) {
    toto();
  }
 );
 
sub toto {
  die ("die");
}
Je souhaite que le die ne tue pas le thread, est ce possible?
Dans la doc, voici ce qui est dit :
die()

Calling die() in a thread indicates an abnormal exit for the thread. Any $SIG{__DIE__} handler in the thread will be called first, and then the thread will exit with a warning message that will contain any arguments passed in the die() call.
Peut on empêcher l'exit de s'exécuter ou bien contourner le comportement de exit thread?

Merci