summaryrefslogtreecommitdiffstats
path: root/misc/thread_pool.c
Commit message (Collapse)AuthorAgeFilesLines
* osdep: rename MP_UNREACHABLENiklas Haas2021-11-031-1/+1
| | | | | It was pointed out on IRC that the name is misleading, since the actual semantics of the macro is to assert first.
* osdep: add MP_UNREACHABLENiklas Haas2021-11-031-1/+1
| | | | | | | | | This seems to work on gcc, clang and mingw as-is, but I made it conditional on __GNUC__ just in case, even though I can't figure out which compilers we care about that don't export this define. Also replace all instances of assert(0) in the code by MP_UNREACHABLE(), which is a strict improvement.
* thread_pool: add a helper functionwm42018-05-241-10/+25
| | | | | The behavior of mp_thread_pool_queue() doesn't or shouldn't change, but the new helper function requires touching its logic.
* thread_pool: move comments to .h filewm42018-05-241-17/+0
|
* thread_pool: set thread namewm42018-05-241-0/+3
|
* thread_pool: make it slightly less dumbwm42018-05-241-40/+137
| | | | | | | | | | | | The existing thread pool code is the most primitive thread pool possible. That's fine, but one annoying thing was that it used a static number of threads. Make it dynamic, so we don't need to "waste" idle threads. This tries to add threads as needed. If threads are idle for some time, destroy them again until a minimum number of threads is reached. Also change the license to ISC.
* misc: add a thread poolwm42017-04-011-0/+125
To be used by the following commits.