* of the GNU Lesser General Public License.
*/
-#include "ucw/lib.h"
-#include "ucw/threads.h"
-#include "ucw/workqueue.h"
-#include "ucw/heap.h"
+#include <ucw/lib.h>
+#include <ucw/threads.h>
+#include <ucw/workqueue.h>
+#include <ucw/heap.h>
static void *
worker_thread_init(void *arg)
pthread_attr_t attr;
if (pthread_attr_init(&attr) < 0 ||
- pthread_attr_setstacksize(&attr, p->stack_size ? : default_thread_stack_size) < 0)
+ pthread_attr_setstacksize(&attr, p->stack_size ? : ucwlib_thread_stack_size) < 0)
ASSERT(0);
for (uns i=0; i < p->num_threads; i++)
static void wt_init(struct worker_thread *t)
{
- log(L_INFO, "INIT %d", t->id);
+ msg(L_INFO, "INIT %d", t->id);
}
static void wt_cleanup(struct worker_thread *t)
{
- log(L_INFO, "CLEANUP %d", t->id);
+ msg(L_INFO, "CLEANUP %d", t->id);
}
struct w {
static void go(struct worker_thread *t, struct work *w)
{
- log(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
+ msg(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
usleep(1);
}
w->w.priority = (i < 250 ? i : 0);
w->id = i;
work_submit(&q, &w->w);
- log(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
+ msg(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
}
struct w *w;
while (w = (struct w *) work_wait(&q))
- log(L_INFO, "Finished request %d", w->id);
+ msg(L_INFO, "Finished request %d", w->id);
work_queue_cleanup(&q);
worker_pool_cleanup(&pool);