Skip to content

Commit

Permalink
fixes for actually running
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna committed Mar 17, 2012
1 parent c4cf064 commit e512027
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/spedye_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ process_args(spedye_conf_t *conf, int argc, char *argv[])
for (i = 0; i < argc; i++) {
printf("[%d] = %s\n", i, argv[i]);
}
conf->worker_count = 10;
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/spedye_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ master_create_workers(spedye_master_t *m)
{
int i;
for (i = 0; i < m->conf->worker_count; i++) {
spedye_worker_t *w = m->workers[i];
spedye_worker_create(&w, m);
spedye_worker_create(&m->workers[i], m);
}
}

Expand All @@ -48,6 +47,7 @@ master_destroy_workers(spedye_master_t *m)
for (i = 0; i < m->conf->worker_count; i++) {
spedye_worker_t *w = m->workers[i];
spedye_worker_destroy(w);
m->workers[i] = NULL;
}
}

Expand All @@ -72,7 +72,7 @@ master_shutdown(uv_async_t* handle, int status)
spedye_master_t *m = handle->data;
m->state = SPEDYE_STOPING;
master_destroy_workers(m);
uv_close((uv_handle_t*)&m->master_wakeup, master_shutdown_closecb);
uv_close((uv_handle_t*)handle, master_shutdown_closecb);
}

int
Expand Down
4 changes: 2 additions & 2 deletions src/spedye_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ worker_shutdown(uv_async_t* handle, int status)
{
spedye_worker_t *w = handle->data;
w->state = SPEDYE_STOPING;
uv_close((uv_handle_t*)&w->worker_wakeup, worker_shutdown_closecb);
uv_close((uv_handle_t*)handle, worker_shutdown_closecb);
}

static void
Expand All @@ -55,7 +55,7 @@ spedye_worker_create(spedye_worker_t **w_out, spedye_master_t *m)

rc = uv_async_init(w->loop, &w->worker_wakeup, worker_shutdown);

w->worker_wakeup.data = m;
w->worker_wakeup.data = w;

*w_out = w;

Expand Down

0 comments on commit e512027

Please sign in to comment.