159 |
|
|
160 |
lscp_status_t lscp_thread_destroy ( lscp_thread_t *pThread ) |
lscp_status_t lscp_thread_destroy ( lscp_thread_t *pThread ) |
161 |
{ |
{ |
162 |
lscp_status_t ret = lscp_thread_cancel(pThread); |
lscp_status_t ret = lscp_thread_join(pThread); |
|
|
|
|
if (ret == LSCP_OK) |
|
|
ret = lscp_thread_join(pThread); |
|
163 |
|
|
164 |
// fprintf(stderr, "lscp_thread_destroy: pThread=%p.\n", pThread); |
// fprintf(stderr, "lscp_thread_destroy: pThread=%p.\n", pThread); |
165 |
|
|
166 |
free(pThread); |
if (ret == LSCP_OK) |
167 |
|
free(pThread); |
168 |
|
|
169 |
return ret; |
return ret; |
170 |
} |
} |