summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_concurrency.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_concurrency.c')
-rw-r--r--lib/libpthread/thread/thr_concurrency.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_concurrency.c b/lib/libpthread/thread/thr_concurrency.c
index 59e8550..daea56c 100644
--- a/lib/libpthread/thread/thr_concurrency.c
+++ b/lib/libpthread/thread/thr_concurrency.c
@@ -84,6 +84,13 @@ _thr_setconcurrency(int new_level)
int i;
int ret;
+ /*
+ * Turn on threaded mode, if failed, it is unnecessary to
+ * do further work.
+ */
+ if (_kse_isthreaded() == 0 && _kse_setthreaded(1))
+ return (EAGAIN);
+
ret = 0;
curthread = _get_curthread();
/* Race condition, but so what. */
OpenPOWER on IntegriCloud