Skip to content

Commit 3f42f12

Browse files
committed
Fixed 'undefined reference to __get_thread' errors.
1 parent 2ec7ec8 commit 3f42f12

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

Diff for: pt-docancel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ int
3131
__pthread_do_cancel (struct pthread_internal_t *p)
3232
{
3333

34-
if(p == __get_thread())
34+
if(p == pthread_self())
3535
call_exit ();
3636
else if(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_HANDLER)
3737
pthread_kill((pthread_t)p, SIGRTMIN);
3838
else
3939
pthread_kill((pthread_t)p, SIGTERM);
4040

4141
return 0;
42-
}
42+
}

Diff for: pt-internal.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ struct pthread_internal_t {
5959
pthread_mutex_t cancel_lock;
6060
};
6161

62-
extern struct pthread_internal_t* __get_thread(void);
63-
6462
/* Has the thread a cancellation request? */
6563
#define PTHREAD_ATTR_FLAG_CANCEL_PENDING 0x00000008
6664

@@ -79,4 +77,4 @@ int __pthread_do_cancel (struct pthread_internal_t *);
7977

8078
void pthread_init(void);
8179

82-
#endif /* _PTHREAD_INTERNAL_H_ */
80+
#endif /* _PTHREAD_INTERNAL_H_ */

Diff for: pt-setcancelstate.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
int
2626
pthread_setcancelstate (int state, int *oldstate)
2727
{
28-
struct pthread_internal_t *p = __get_thread ();
28+
struct pthread_internal_t *p = pthread_self();
2929
int newflags;
3030

3131
pthread_init();
@@ -54,4 +54,4 @@ pthread_setcancelstate (int state, int *oldstate)
5454
__pthread_do_cancel(p);
5555

5656
return 0;
57-
}
57+
}

Diff for: pt-setcanceltype.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
int
2626
pthread_setcanceltype (int type, int *oldtype)
2727
{
28-
struct pthread_internal_t *p = __get_thread ();
28+
struct pthread_internal_t *p = pthread_self();
2929
int newflags;
3030

3131
pthread_init();
@@ -54,4 +54,4 @@ pthread_setcanceltype (int type, int *oldtype)
5454
__pthread_do_cancel(p);
5555

5656
return 0;
57-
}
57+
}

Diff for: pt-testcancel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
void
2525
pthread_testcancel (void)
2626
{
27-
struct pthread_internal_t *p = __get_thread ();
27+
struct pthread_internal_t *p = pthread_self();
2828
int cancelled;
2929

3030
pthread_init();
@@ -36,4 +36,4 @@ pthread_testcancel (void)
3636
if (cancelled)
3737
pthread_exit (PTHREAD_CANCELED);
3838

39-
}
39+
}

0 commit comments

Comments
 (0)