Changeset 5925 for branches/newapi
- Timestamp:
- 12/03/07 07:51:06 (12 months ago)
- Location:
- branches/newapi/licq
- Files:
-
- 2 modified
-
licq/thread/thread.h (modified) (1 diff)
-
src/thread/thread.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newapi/licq/licq/thread/thread.h
r5920 r5925 73 73 }; 74 74 75 class Current 76 { 77 public: 78 /** 79 * Exits the calling thread. 80 * 81 * @param status The thread's exit status. 82 */ 83 static void exit(int status) LICQ_NO_RETURN; 84 }; 85 75 86 class Entry 76 87 { -
branches/newapi/licq/src/thread/thread.cpp
r5609 r5925 32 32 #include <signal.h> 33 33 34 void Licq::Thread::Current::exit(int status) 35 { 36 ::pthread_exit(reinterpret_cast<void*>(status)); 37 } 38 34 39 void Licq::Thread::Entry::exit(int status) 35 40 { 36 ::pthread_exit(new int(status));41 Licq::Thread::Current::exit(status); 37 42 } 38 43 … … 131 136 static void* threadStartRoutine(void* arg) 132 137 { 138 // Unblock SIGTERM 139 sigset_t mask; 140 sigemptyset(&mask); 141 sigaddset(&mask, SIGTERM); 142 DBG(const int error =) ::pthread_sigmask(SIG_UNBLOCK, &mask, NULL); 143 assert(error == 0); 144 133 145 Licq::Thread::Entry* entry = static_cast<Licq::Thread::Entry*>(arg); 134 146 int ret = -1; … … 141 153 // Empty 142 154 } 143 return new int(ret);155 return reinterpret_cast<void*>(ret); 144 156 } 145 157 … … 186 198 { 187 199 myState = StateJoined; 188 int* iret = static_cast<int*>(ret); 189 int status = *iret; 190 delete iret; 191 return status; 200 return reinterpret_cast<int>(ret); 192 201 } 193 202 }
