Commit d313d52c by Sebastian Huber Committed by Sebastian Huber

[RTEMS] Fix libgomp for nthreads == 1

libgomp/

        * config/rtems/pool.h (gomp_get_thread_pool): Return proper
        thread pool in case nthreads == 1.

From-SVN: r243179
parent 310a7f96
2016-12-02 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config/rtems/pool.h (gomp_get_thread_pool): Return proper
thread pool in case nthreads == 1.
2016-11-30 Alexander Monakov <amonakov@ispras.ru> 2016-11-30 Alexander Monakov <amonakov@ispras.ru>
* config/nvptx/env.c: Delete. * config/nvptx/env.c: Delete.
......
...@@ -87,14 +87,12 @@ static inline struct gomp_thread_pool * ...@@ -87,14 +87,12 @@ static inline struct gomp_thread_pool *
gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads) gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads)
{ {
struct gomp_thread_pool *pool; struct gomp_thread_pool *pool;
struct gomp_thread_pool_reservoir *res;
if (__builtin_expect (thr->thread_pool == NULL, 0)) if (__builtin_expect (thr->thread_pool == NULL, 0))
pthread_setspecific (gomp_thread_destructor, thr); pthread_setspecific (gomp_thread_destructor, thr);
if (nthreads != 1) res = gomp_get_thread_pool_reservoir ();
{
struct gomp_thread_pool_reservoir *res =
gomp_get_thread_pool_reservoir ();
if (res != NULL) if (res != NULL)
{ {
gomp_sem_wait (&res->available); gomp_sem_wait (&res->available);
...@@ -106,9 +104,7 @@ gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads) ...@@ -106,9 +104,7 @@ gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads)
} }
else else
pool = gomp_get_own_thread_pool (thr, nthreads); pool = gomp_get_own_thread_pool (thr, nthreads);
}
else
pool = NULL;
return pool; return pool;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment