Skip to content

Commit

Permalink
Replace useless tid parameters with NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
zorjen122 committed Sep 16, 2024
1 parent 72a3116 commit 6eaeb6d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/kernel/thrdpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ static void __thrdpool_terminate(int in_pool, thrdpool_t *pool)
static int __thrdpool_create_threads(size_t nthreads, thrdpool_t *pool)
{
pthread_attr_t attr;
pthread_t tid;
int ret;

ret = pthread_attr_init(&attr);
Expand All @@ -128,7 +127,7 @@ static int __thrdpool_create_threads(size_t nthreads, thrdpool_t *pool)

while (pool->nthreads < nthreads)
{
ret = pthread_create(&tid, &attr, __thrdpool_routine, pool);
ret = pthread_create(NULL, &attr, __thrdpool_routine, pool);
if (ret == 0)
pool->nthreads++;
else
Expand Down Expand Up @@ -218,7 +217,6 @@ int thrdpool_in_pool(thrdpool_t *pool)
int thrdpool_increase(thrdpool_t *pool)
{
pthread_attr_t attr;
pthread_t tid;
int ret;

ret = pthread_attr_init(&attr);
Expand All @@ -228,7 +226,7 @@ int thrdpool_increase(thrdpool_t *pool)
pthread_attr_setstacksize(&attr, pool->stacksize);

pthread_mutex_lock(&pool->mutex);
ret = pthread_create(&tid, &attr, __thrdpool_routine, pool);
ret = pthread_create(NULL, &attr, __thrdpool_routine, pool);
if (ret == 0)
pool->nthreads++;

Expand Down

0 comments on commit 6eaeb6d

Please sign in to comment.