Merge pull request #758 from Kijewski/issue-755

Fix `pthread_self()` confusion
dev/timer
Christian Mehlis 9 years ago
commit 2de9619f21

@ -51,9 +51,10 @@ enum pthread_thread_status {
};
typedef struct pthread_thread {
int thread_pid;
enum pthread_thread_status status;
int joining_thread;
int thread_pid;
void *returnval;
bool should_cancel;
@ -159,6 +160,7 @@ int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*sta
void pthread_exit(void *retval)
{
pthread_thread_t *self = pthread_sched_threads[pthread_self()];
self->thread_pid = -1;
DEBUG("pthread_exit(%p), self == %p\n", retval, (void *) self);
if (self->status != PTS_DETACHED) {
self->returnval = retval;

Loading…
Cancel
Save