Changeset 2943 in Sophya for trunk/SophyaLib/SysTools/zthread.cc


Ignore:
Timestamp:
Apr 26, 2006, 5:22:09 PM (19 years ago)
Author:
ansari
Message:

ajout methode ZThread::kill() pour envoi de signal a un thread + remplacement CancelThread par StopThread (par kill/SIGUSR1) dans Commander (commander.cc) + amelioration documentation , Reza 26/4/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/zthread.cc

    r2759 r2943  
    66#include <stdlib.h>
    77#include <stdio.h>
     8#include <pthread.h>
     9#include <signal.h>
    810
    911/*!
     
    104106}
    105107
     108/*!
     109  Calls the pthread_kill to deliver a signal to the corresponding thread
     110*/
     111void ZThread::kill(int sig)
     112{
     113  if (!_initok) throw ZThreadExc("ZThread::kill() - thread not started !");
     114  int rc = pthread_kill(_thr, sig);
     115  CheckSt(rc,"ZThread::kill() - Pb pthread_kill() "); 
     116  setRC(-76);     
     117}
     118
    106119
    107120/*!
Note: See TracChangeset for help on using the changeset viewer.