#include "lib/lib.h"
#include "lib/mempool.h"
#include "lib/fastbuf.h"
+#include "lib/threads.h"
#include "images/images.h"
#include "images/color.h"
pthread_t threads[TEST_THREADS_COUNT - 1];
pthread_attr_t attr;
if (pthread_attr_init(&attr) < 0 ||
- pthread_attr_setstacksize(&attr, 1 << 20) < 0)
+ pthread_attr_setstacksize(&attr, default_thread_stack_size) < 0)
ASSERT(0);
for (uns i = 0; i < TEST_THREADS_COUNT - 1; i++)
{
DBG("ASIO: INIT");
asio_wpool.num_threads = 1;
- asio_wpool.stack_size = 65536;
worker_pool_init(&asio_wpool);
}
*/
#include "lib/lib.h"
+#include "lib/threads.h"
#include "lib/workqueue.h"
static void *
pthread_attr_t attr;
if (pthread_attr_init(&attr) < 0 ||
- pthread_attr_setstacksize(&attr, p->stack_size) < 0)
+ pthread_attr_setstacksize(&attr, p->stack_size ? : default_thread_stack_size) < 0)
ASSERT(0);
for (uns i=0; i < p->num_threads; i++)
struct worker_pool {
struct raw_queue requests;
uns num_threads;
- uns stack_size;
+ uns stack_size; // 0 for default
struct worker_thread *(*new_thread)(void); // default: xmalloc the struct
void (*free_thread)(struct worker_thread *t); // default: xfree
void (*init_thread)(struct worker_thread *t); // default: empty