bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

return some value in Thread::Detach()


From: Vaclav Haisman
Subject: return some value in Thread::Detach()
Date: Tue, 26 Jun 2001 23:55:30 +0200 (CEST)

Hi,
this patch makes Thread::Detach return some value.

There is another thing:
thread.cpp: In member function `void cc_Thread::setTimer(long unsigned
int)':
thread.cpp:435: warning: statement with no effect

The line 435 is:         _arm;
I think there is probably something missing.


The patch:
Index: thread.cpp
===================================================================
RCS file: /cvsroot/cplusplus/CommonC++/posix/thread.cpp,v
retrieving revision 1.34
diff -c -r1.34 thread.cpp
*** thread.cpp  2001/06/22 14:47:12     1.34
--- thread.cpp  2001/06/26 21:54:29
***************
*** 307,314 ****

        _start = start;
        rtn = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
!       if(!rtn && _tid)
                pthread_detach(_tid);
  }

  void Thread::Terminate(void)
--- 307,318 ----

        _start = start;
        rtn = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
!       if(!rtn && _tid) {
                pthread_detach(_tid);
+                 return 0;
+         }
+         else
+                 return -1;
  }

  void Thread::Terminate(void)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]