Skip to content

question about threads_keepalive variable. #88

@wind0ws

Description

@wind0ws

Hi, thanks for this awesome lib.

In thpool.c (line 37), here is static volatile int threads_keepalive; , why not put threads_keepalive on struct thpool_?

Assume the following scenario:

  1. Create thread pool A (Now threads_keepalive is set to 1);
  2. Call add_task on thread pool A;
  3. Create thread pool B (Now threads_keepalive is set to 1);
  4. Call add_task on thread pool B;
  5. Destroy thread pool A (Now threads_keepalive is set to 0);
  6. Call add_task on thread pool B ; ( task won't execute, because of threads_keepalive == 0 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions