summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_suspend_np.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_suspend_np.c')
-rw-r--r--lib/libpthread/thread/thr_suspend_np.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_suspend_np.c b/lib/libpthread/thread/thr_suspend_np.c
index 083f552..5c204a2 100644
--- a/lib/libpthread/thread/thr_suspend_np.c
+++ b/lib/libpthread/thread/thr_suspend_np.c
@@ -32,15 +32,16 @@
* $FreeBSD$
*/
#include <errno.h>
-#ifdef _THREAD_SAFE
#include <pthread.h>
#include "pthread_private.h"
static void finish_suspension(void *arg);
+#pragma weak pthread_suspend_np=_pthread_suspend_np
+
/* Suspend a thread: */
int
-pthread_suspend_np(pthread_t thread)
+_pthread_suspend_np(pthread_t thread)
{
int ret;
@@ -144,9 +145,10 @@ pthread_suspend_np(pthread_t thread)
static void
finish_suspension(void *arg)
{
- if (_thread_run->suspended != SUSP_NO)
+ struct pthread *curthread = _get_curthread();
+
+ if (curthread->suspended != SUSP_NO)
_thread_kern_sched_state(PS_SUSPENDED, __FILE__, __LINE__);
}
-#endif
OpenPOWER on IntegriCloud