Changeset 3718 in Sophya for trunk/SophyaLib/SysTools
- Timestamp:
- Dec 28, 2009, 10:05:51 PM (16 years ago)
- Location:
- trunk/SophyaLib/SysTools
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/Makefile
r3615 r3718 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)p dlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)zthread.o $(SOPHYAOBJP)timing.o6 rm -f $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)parlex.o $(SOPHYAOBJP)pdlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)zthread.o $(SOPHYAOBJP)timing.o 7 7 rm -f $(SOPHYALIBP)libSysTools.a 8 8 9 $(SOPHYALIBP)libSysTools.a : $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)p dlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)timing.o $(SOPHYAOBJP)zthread.o9 $(SOPHYALIBP)libSysTools.a : $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)parlex.o $(SOPHYAOBJP)pdlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)timing.o $(SOPHYAOBJP)zthread.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist 12 12 13 $(SOPHYAOBJP)cexpre.o: cexpre.cc $(SOPHYAINCP)sopnamsp.h \ 14 cexpre.h $(SOPHYAINCP)machdefs.h \ 13 $(SOPHYAOBJP)cexpre.o: cexpre.cc $(SOPHYAINCP)sopnamsp.h cexpre.h \ 14 $(SOPHYAINCP)machdefs.h \ 15 $(SOPHYAINCP)osx_values.h \ 15 16 $(SOPHYAINCP)pexceptions.h \ 16 17 $(SOPHYAINCP)machdefs.h \ 17 18 $(SOPHYAINCP)srandgen.h \ 19 $(SOPHYAINCP)machdefs.h \ 18 20 $(SOPHYAINCP)randinterf.h \ 19 $(SOPHYAINCP)anydataobj.h 21 $(SOPHYAINCP)machdefs.h \ 22 $(SOPHYAINCP)anydataobj.h \ 23 $(SOPHYAINCP)machdefs.h 20 24 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cexpre.cc 21 25 22 26 $(SOPHYAOBJP)commander.o: commander.cc $(SOPHYAINCP)sopnamsp.h \ 23 commander.h $(SOPHYAINCP)machdefs.h pdlmgr.h\24 $(SOPHYAINCP) dvlist.h \25 $(SOPHYAINCP) objfio.h \27 commander.h $(SOPHYAINCP)machdefs.h \ 28 $(SOPHYAINCP)osx_values.h pdlmgr.h \ 29 $(SOPHYAINCP)dvlist.h $(SOPHYAINCP)objfio.h \ 26 30 $(SOPHYAINCP)machdefs.h \ 27 31 $(SOPHYAINCP)anydataobj.h \ 32 $(SOPHYAINCP)machdefs.h \ 28 33 $(SOPHYAINCP)ppersist.h \ 34 $(SOPHYAINCP)machdefs.h \ 29 35 $(SOPHYAINCP)pexceptions.h \ 30 $(SOPHYAINCP) gnumd5.h \36 $(SOPHYAINCP)machdefs.h $(SOPHYAINCP)gnumd5.h \ 31 37 $(SOPHYAINCP)ppfbinstream.h \ 38 $(SOPHYAINCP)machdefs.h \ 32 39 $(SOPHYAINCP)rawstream.h \ 40 $(SOPHYAINCP)machdefs.h \ 33 41 $(SOPHYAINCP)ppfnametag.h \ 34 $(SOPHYAINCP)mutyv.h \ 35 $(SOPHYAINCP)timestamp.h ctimer.h \ 36 $(SOPHYAINCP)strutil.h \ 37 $(SOPHYAINCP)strutilxx.h cexpre.h \ 38 $(SOPHYAINCP)pexceptions.h rpneval.h \ 42 $(SOPHYAINCP)ppersist.h $(SOPHYAINCP)mutyv.h \ 43 $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP)timestamp.h \ 45 $(SOPHYAINCP)machdefs.h $(SOPHYAINCP)objfio.h \ 46 ctimer.h $(SOPHYAINCP)strutil.h \ 47 $(SOPHYAINCP)strutilxx.h \ 48 $(SOPHYAINCP)machdefs.h cexpre.h rpneval.h \ 39 49 $(SOPHYAINCP)srandgen.h \ 40 $(SOPHYAINCP)randinterf.h zthread.h 50 $(SOPHYAINCP)machdefs.h \ 51 $(SOPHYAINCP)randinterf.h \ 52 $(SOPHYAINCP)machdefs.h \ 53 $(SOPHYAINCP)anydataobj.h zthread.h 41 54 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ commander.cc 42 55 43 56 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP) sopnamsp.h ctimer.h57 $(SOPHYAINCP)osx_values.h ctimer.h 45 58 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ ctimer.cc 46 59 47 60 $(SOPHYAOBJP)cxxcmplnk.o: cxxcmplnk.cc $(SOPHYAINCP)sopnamsp.h \ 48 61 cxxcmplnk.h $(SOPHYAINCP)machdefs.h \ 62 $(SOPHYAINCP)osx_values.h \ 49 63 $(SOPHYAINCP)sspvflags.h 50 64 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cxxcmplnk.cc 51 65 66 $(SOPHYAOBJP)parlex.o: parlex.cc parlex.h zthread.h \ 67 $(SOPHYAINCP)machdefs.h \ 68 $(SOPHYAINCP)osx_values.h \ 69 $(SOPHYAINCP)pexceptions.h \ 70 $(SOPHYAINCP)machdefs.h 71 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ parlex.cc 72 52 73 $(SOPHYAOBJP)pdlmgr.o: pdlmgr.cc $(SOPHYAINCP)machdefs.h \ 74 $(SOPHYAINCP)osx_values.h \ 53 75 $(SOPHYAINCP)sopnamsp.h pdlmgr.h 54 76 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ pdlmgr.cc 55 77 56 78 $(SOPHYAOBJP)periodic.o: periodic.cc $(SOPHYAINCP)sopnamsp.h \ 57 $(SOPHYAINCP)machdefs.h periodic.h 79 $(SOPHYAINCP)machdefs.h \ 80 $(SOPHYAINCP)osx_values.h periodic.h 58 81 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ periodic.cc 59 82 60 $(SOPHYAOBJP)psighand.o: psighand.cc $(SOPHYAINCP)sopnamsp.h \ 61 psighand.h $(SOPHYAINCP)machdefs.h \ 83 $(SOPHYAOBJP)psighand.o: psighand.cc $(SOPHYAINCP)sopnamsp.h psighand.h \ 84 $(SOPHYAINCP)machdefs.h \ 85 $(SOPHYAINCP)osx_values.h \ 62 86 $(SOPHYAINCP)pexceptions.h \ 63 87 $(SOPHYAINCP)machdefs.h 64 88 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ psighand.cc 65 89 66 $(SOPHYAOBJP)resusage.o: resusage.cc $(SOPHYAINCP)sopnamsp.h \ 67 resusage.h $(SOPHYAINCP)machdefs.h 90 $(SOPHYAOBJP)resusage.o: resusage.cc $(SOPHYAINCP)sopnamsp.h resusage.h \ 91 $(SOPHYAINCP)machdefs.h \ 92 $(SOPHYAINCP)osx_values.h 68 93 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ resusage.cc 69 94 70 $(SOPHYAOBJP)rpneval.o: rpneval.cc $(SOPHYAINCP)sopnamsp.h \ 71 rpneval.h $(SOPHYAINCP)machdefs.h \ 95 $(SOPHYAOBJP)rpneval.o: rpneval.cc $(SOPHYAINCP)sopnamsp.h rpneval.h \ 96 $(SOPHYAINCP)machdefs.h \ 97 $(SOPHYAINCP)osx_values.h \ 72 98 $(SOPHYAINCP)pexceptions.h \ 73 99 $(SOPHYAINCP)machdefs.h \ 74 100 $(SOPHYAINCP)strutilxx.h \ 101 $(SOPHYAINCP)machdefs.h \ 75 102 $(SOPHYAINCP)srandgen.h \ 103 $(SOPHYAINCP)machdefs.h \ 76 104 $(SOPHYAINCP)randinterf.h \ 77 $(SOPHYAINCP)anydataobj.h 105 $(SOPHYAINCP)machdefs.h \ 106 $(SOPHYAINCP)anydataobj.h \ 107 $(SOPHYAINCP)machdefs.h 78 108 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ rpneval.cc 79 109 80 $(SOPHYAOBJP)zthread.o: zthread.cc $(SOPHYAINCP)sopnamsp.h \ 81 zthread.h $(SOPHYAINCP)machdefs.h \ 110 $(SOPHYAOBJP)zthread.o: zthread.cc $(SOPHYAINCP)sopnamsp.h zthread.h \ 111 $(SOPHYAINCP)machdefs.h \ 112 $(SOPHYAINCP)osx_values.h \ 82 113 $(SOPHYAINCP)pexceptions.h \ 83 114 $(SOPHYAINCP)machdefs.h -
trunk/SophyaLib/SysTools/objlist.list
r2510 r3718 3 3 ctimer.o 4 4 cxxcmplnk.o 5 parlex.o 5 6 pdlmgr.o 6 7 periodic.o -
trunk/SophyaLib/SysTools/smakefile
r3615 r3718 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)p dlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)zthread.o $(SOPHYAOBJP)timing.o6 rm -f $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)parlex.o $(SOPHYAOBJP)pdlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)zthread.o $(SOPHYAOBJP)timing.o 7 7 rm -f $(SOPHYALIBP)libSysTools.a 8 8 9 $(SOPHYALIBP)libSysTools.a : $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)p dlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)timing.o $(SOPHYAOBJP)zthread.o9 $(SOPHYALIBP)libSysTools.a : $(SOPHYAOBJP)cexpre.o $(SOPHYAOBJP)commander.o $(SOPHYAOBJP)ctimer.o $(SOPHYAOBJP)cxxcmplnk.o $(SOPHYAOBJP)parlex.o $(SOPHYAOBJP)pdlmgr.o $(SOPHYAOBJP)periodic.o $(SOPHYAOBJP)psighand.o $(SOPHYAOBJP)resusage.o $(SOPHYAOBJP)rpneval.o $(SOPHYAOBJP)timing.o $(SOPHYAOBJP)zthread.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist 12 12 13 $(SOPHYAOBJP)cexpre.o: cexpre.cc $(SOPHYAINCP)sopnamsp.h \ 14 cexpre.h $(SOPHYAINCP)machdefs.h \ 13 $(SOPHYAOBJP)cexpre.o: cexpre.cc $(SOPHYAINCP)sopnamsp.h cexpre.h \ 14 $(SOPHYAINCP)machdefs.h \ 15 $(SOPHYAINCP)osx_values.h \ 15 16 $(SOPHYAINCP)pexceptions.h \ 16 17 $(SOPHYAINCP)machdefs.h \ 17 18 $(SOPHYAINCP)srandgen.h \ 19 $(SOPHYAINCP)machdefs.h \ 18 20 $(SOPHYAINCP)randinterf.h \ 19 $(SOPHYAINCP)anydataobj.h 21 $(SOPHYAINCP)machdefs.h \ 22 $(SOPHYAINCP)anydataobj.h \ 23 $(SOPHYAINCP)machdefs.h 20 24 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cexpre.cc 21 25 22 26 $(SOPHYAOBJP)commander.o: commander.cc $(SOPHYAINCP)sopnamsp.h \ 23 commander.h $(SOPHYAINCP)machdefs.h pdlmgr.h\24 $(SOPHYAINCP) dvlist.h \25 $(SOPHYAINCP) objfio.h \27 commander.h $(SOPHYAINCP)machdefs.h \ 28 $(SOPHYAINCP)osx_values.h pdlmgr.h \ 29 $(SOPHYAINCP)dvlist.h $(SOPHYAINCP)objfio.h \ 26 30 $(SOPHYAINCP)machdefs.h \ 27 31 $(SOPHYAINCP)anydataobj.h \ 32 $(SOPHYAINCP)machdefs.h \ 28 33 $(SOPHYAINCP)ppersist.h \ 34 $(SOPHYAINCP)machdefs.h \ 29 35 $(SOPHYAINCP)pexceptions.h \ 30 $(SOPHYAINCP) gnumd5.h \36 $(SOPHYAINCP)machdefs.h $(SOPHYAINCP)gnumd5.h \ 31 37 $(SOPHYAINCP)ppfbinstream.h \ 38 $(SOPHYAINCP)machdefs.h \ 32 39 $(SOPHYAINCP)rawstream.h \ 40 $(SOPHYAINCP)machdefs.h \ 33 41 $(SOPHYAINCP)ppfnametag.h \ 34 $(SOPHYAINCP)mutyv.h \ 35 $(SOPHYAINCP)timestamp.h ctimer.h \ 36 $(SOPHYAINCP)strutil.h \ 37 $(SOPHYAINCP)strutilxx.h cexpre.h \ 38 $(SOPHYAINCP)pexceptions.h rpneval.h \ 42 $(SOPHYAINCP)ppersist.h $(SOPHYAINCP)mutyv.h \ 43 $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP)timestamp.h \ 45 $(SOPHYAINCP)machdefs.h $(SOPHYAINCP)objfio.h \ 46 ctimer.h $(SOPHYAINCP)strutil.h \ 47 $(SOPHYAINCP)strutilxx.h \ 48 $(SOPHYAINCP)machdefs.h cexpre.h rpneval.h \ 39 49 $(SOPHYAINCP)srandgen.h \ 40 $(SOPHYAINCP)randinterf.h zthread.h 50 $(SOPHYAINCP)machdefs.h \ 51 $(SOPHYAINCP)randinterf.h \ 52 $(SOPHYAINCP)machdefs.h \ 53 $(SOPHYAINCP)anydataobj.h zthread.h 41 54 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ commander.cc 42 55 43 56 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP) sopnamsp.h ctimer.h57 $(SOPHYAINCP)osx_values.h ctimer.h 45 58 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ ctimer.cc 46 59 47 60 $(SOPHYAOBJP)cxxcmplnk.o: cxxcmplnk.cc $(SOPHYAINCP)sopnamsp.h \ 48 61 cxxcmplnk.h $(SOPHYAINCP)machdefs.h \ 62 $(SOPHYAINCP)osx_values.h \ 49 63 $(SOPHYAINCP)sspvflags.h 50 64 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cxxcmplnk.cc 51 65 66 $(SOPHYAOBJP)parlex.o: parlex.cc parlex.h zthread.h \ 67 $(SOPHYAINCP)machdefs.h \ 68 $(SOPHYAINCP)osx_values.h \ 69 $(SOPHYAINCP)pexceptions.h \ 70 $(SOPHYAINCP)machdefs.h 71 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ parlex.cc 72 52 73 $(SOPHYAOBJP)pdlmgr.o: pdlmgr.cc $(SOPHYAINCP)machdefs.h \ 74 $(SOPHYAINCP)osx_values.h \ 53 75 $(SOPHYAINCP)sopnamsp.h pdlmgr.h 54 76 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ pdlmgr.cc 55 77 56 78 $(SOPHYAOBJP)periodic.o: periodic.cc $(SOPHYAINCP)sopnamsp.h \ 57 $(SOPHYAINCP)machdefs.h periodic.h 79 $(SOPHYAINCP)machdefs.h \ 80 $(SOPHYAINCP)osx_values.h periodic.h 58 81 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ periodic.cc 59 82 60 $(SOPHYAOBJP)psighand.o: psighand.cc $(SOPHYAINCP)sopnamsp.h \ 61 psighand.h $(SOPHYAINCP)machdefs.h \ 83 $(SOPHYAOBJP)psighand.o: psighand.cc $(SOPHYAINCP)sopnamsp.h psighand.h \ 84 $(SOPHYAINCP)machdefs.h \ 85 $(SOPHYAINCP)osx_values.h \ 62 86 $(SOPHYAINCP)pexceptions.h \ 63 87 $(SOPHYAINCP)machdefs.h 64 88 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ psighand.cc 65 89 66 $(SOPHYAOBJP)resusage.o: resusage.cc $(SOPHYAINCP)sopnamsp.h \ 67 resusage.h $(SOPHYAINCP)machdefs.h 90 $(SOPHYAOBJP)resusage.o: resusage.cc $(SOPHYAINCP)sopnamsp.h resusage.h \ 91 $(SOPHYAINCP)machdefs.h \ 92 $(SOPHYAINCP)osx_values.h 68 93 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ resusage.cc 69 94 70 $(SOPHYAOBJP)rpneval.o: rpneval.cc $(SOPHYAINCP)sopnamsp.h \ 71 rpneval.h $(SOPHYAINCP)machdefs.h \ 95 $(SOPHYAOBJP)rpneval.o: rpneval.cc $(SOPHYAINCP)sopnamsp.h rpneval.h \ 96 $(SOPHYAINCP)machdefs.h \ 97 $(SOPHYAINCP)osx_values.h \ 72 98 $(SOPHYAINCP)pexceptions.h \ 73 99 $(SOPHYAINCP)machdefs.h \ 74 100 $(SOPHYAINCP)strutilxx.h \ 101 $(SOPHYAINCP)machdefs.h \ 75 102 $(SOPHYAINCP)srandgen.h \ 103 $(SOPHYAINCP)machdefs.h \ 76 104 $(SOPHYAINCP)randinterf.h \ 77 $(SOPHYAINCP)anydataobj.h 105 $(SOPHYAINCP)machdefs.h \ 106 $(SOPHYAINCP)anydataobj.h \ 107 $(SOPHYAINCP)machdefs.h 78 108 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ rpneval.cc 79 109 80 $(SOPHYAOBJP)zthread.o: zthread.cc $(SOPHYAINCP)sopnamsp.h \ 81 zthread.h $(SOPHYAINCP)machdefs.h \ 110 $(SOPHYAOBJP)zthread.o: zthread.cc $(SOPHYAINCP)sopnamsp.h zthread.h \ 111 $(SOPHYAINCP)machdefs.h \ 112 $(SOPHYAINCP)osx_values.h \ 82 113 $(SOPHYAINCP)pexceptions.h \ 83 114 $(SOPHYAINCP)machdefs.h -
trunk/SophyaLib/SysTools/zthread.cc
r3619 r3718 63 63 { 64 64 ZThread * thr = (ZThread *)xthr; 65 if(thr->_status == 1) thr->_status = 2;65 if(thr->_status == 2) thr->_status = 3; 66 66 return; 67 67 } … … 76 76 /* ------ Classe ZThread ------- */ 77 77 /*! 78 Constructor, with optional specification of the thread stack size. 78 Constructor, with optional specification of the thread stack size in bytes. 79 if not specified or zero, defaut system stack size is used. 79 80 */ 80 81 ZThread::ZThread(size_t stacksize) 81 82 { 82 83 _status = 0; 84 _fgstarted = false; 83 85 _ssize = 0; 84 86 _act = NULL; … … 93 95 94 96 /*! 95 Method which starts the thread. 97 Method which starts the thread. 98 The thread object is created by a call to pthread_create() in this method. 96 99 */ 97 100 void ZThread::start() 98 101 { 99 if ( IfStarted() ) throw ZThreadExc("ZThread::Start() - Already started thread !"); 102 if ( _fgstarted ) throw ZThreadExc("ZThread::Start() - Already started thread !"); 103 _fgstarted = true; 104 _status = 1; 100 105 int rc; 101 106 pthread_attr_t tha; … … 154 159 { 155 160 if (_act) _act(_usp); 156 setRC(0);161 exit(0); 157 162 return; 158 163 } … … 165 170 void ZThread::run_p() 166 171 { 167 _status = 1;172 _status = 2; 168 173 pthread_cleanup_push(zthr_cleanup, (void *)this); 169 174 run(); 170 _status = 2;175 _status = 3; 171 176 pthread_exit(&(_rc)); 172 177 pthread_cleanup_pop(0); … … 212 217 213 218 /*! 214 Constructor: Creates a associated pair of POSIX \c pthread_mutex_t219 Constructor: Creates an associated pair of POSIX \c pthread_mutex_t 215 220 and \c pthread_cond_t objects 216 221 \param : if fgd == true , the destructor call pthread_mutex_destroy/pthread_cond_destroy -
trunk/SophyaLib/SysTools/zthread.h
r3586 r3718 31 31 explicit ZThread(size_t stacksize=0); 32 32 virtual ~ZThread(); 33 //! Change the thread stack-size, specified in bytes. Can only be called before the thread is started 34 inline void setStackSize(size_t ssz) { _ssize=ssz; } 35 //! Change the thread stack-size, specified in kilobytes. Can only be called before the thread is started 36 inline void setStackSizekb(size_t sszk) { _ssize=sszk*1024; } 37 33 38 void start(); 34 39 void cancel(); 35 40 void kill(int sig); 41 void join(); 36 42 37 void join();38 43 virtual void run(); 39 44 40 45 //! Returns true if the thread has been created / started 41 bool IfStarted() { return (( _status > 0) ? true : false); }46 bool IfStarted() { return (((_fgstarted)||(_status>0)) ? true : false); } 42 47 //! Returns true if the thread is running 43 bool IfRunning() { return ((_status == 1) ? true : false); }48 bool IfRunning() { return ((_status == 2) ? true : false); } 44 49 //! Returns true if the thread has ended normally 45 bool IfEnded() { return ((_status == 2) ? true : false); }50 bool IfEnded() { return ((_status == 3) ? true : false); } 46 51 //! Returns true if the thread has been stopped (killed/canceled) 47 bool IfStopped() { return ((_status == 3) ? true : false); }52 bool IfStopped() { return ((_status == 5) ? true : false); } 48 53 49 54 //! Sets the return code for the thread object … … 77 82 // PTHREAD_CANCEL_DEFERRED ou PTHREAD_CANCEL_ASYNCHRONOUS 78 83 84 /*! 85 \brief This method is only for internal use by zthread.cc and should not be called by users 86 */ 79 87 virtual void run_p(); 80 88 … … 83 91 size_t _ssize; 84 92 int _rc; 85 int _status; // 0 : not started, 1 : running, 2: ended, 3:stopped86 93 int _status; // 0 : not started, 1 : started, 2: running, 3: ended, 5:stopped 94 bool _fgstarted; // false -> true par appel a start() 87 95 ZThreadAction _act; 88 96 void * _usp;
Note:
See TracChangeset
for help on using the changeset viewer.