Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace useless tid parameters with NULL #1623

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace useless tid parameters with NULL
  • Loading branch information
zorjen122 committed Sep 16, 2024
commit 6eaeb6dd3c1352f76d9206711f6d30f3bc935efd
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
Loading