bankd: Don't create 10 workers, but 'num_slots' workers

Change-Id: Ie86321e3f61ed86bbbe2ca8cfbd9edde6060bb9f
changes/97/13497/1
Harald Welte 4 years ago
parent f4b16f1c11
commit a0f395043e
  1. 1
      src/bankd.h
  2. 8
      src/bankd_main.c

@ -83,6 +83,7 @@ struct bankd_worker {
struct bankd {
struct {
uint16_t bank_id;
uint16_t num_slots;
} cfg;
struct app_comp_id comp_id;

@ -76,6 +76,10 @@ static void bankd_init(struct bankd *bankd)
INIT_LLIST_HEAD(&bankd->workers);
pthread_mutex_init(&bankd->workers_mutex, NULL);
/* set some defaults, overridden by commandline/config */
bankd->cfg.bank_id = 1;
bankd->cfg.num_slots = 8;
bankd->comp_id.type = ComponentType_remsimBankd;
OSMO_STRLCPY_ARRAY(bankd->comp_id.name, "fixme-name");
OSMO_STRLCPY_ARRAY(bankd->comp_id.software, "remsim-bankd");
@ -187,8 +191,8 @@ int main(int argc, char **argv)
exit(1);
g_bankd->accept_fd = rc;
/* create worker threads. FIXME: one per reader/slot! */
for (i = 0; i < 10; i++) {
/* create worker threads: One per reader/slot! */
for (i = 0; i < g_bankd->cfg.num_slots; i++) {
struct bankd_worker *w;
w = bankd_create_worker(g_bankd, i);
if (!w)

Loading…
Cancel
Save