Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
idnode: delay save thread creation
  • Loading branch information
perexg committed Apr 7, 2016
1 parent 22226e6 commit 1681799
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/idnode.c
Expand Up @@ -1925,14 +1925,18 @@ save_thread ( void *aux )
* *************************************************************************/

void
idnode_init(void)
idnode_boot(void)
{
RB_INIT(&idnodes);
RB_INIT(&idclasses);
RB_INIT(&idrootclasses);
TAILQ_INIT(&idnodes_save);

tvh_cond_init(&save_cond);
}

void
idnode_init(void)
{
atomic_set(&save_running, 1);
tvhthread_create(&save_tid, NULL, save_thread, NULL, "save");
}
Expand Down
1 change: 1 addition & 0 deletions src/idnode.h
Expand Up @@ -192,6 +192,7 @@ typedef LIST_HEAD(,idnode_filter_ele) idnode_filter_t;
extern idnode_t tvhlog_conf;
extern const idclass_t tvhlog_conf_class;

void idnode_boot(void);
void idnode_init(void);
void idnode_done(void);

Expand Down
3 changes: 2 additions & 1 deletion src/main.c
Expand Up @@ -1054,7 +1054,7 @@ main(int argc, char **argv)
}

uuid_init();
idnode_init();
idnode_boot();
config_boot(opt_config, gid, uid);
tcp_server_preinit(opt_ipv6);
http_server_init(opt_bindaddr); // bind to ports only
Expand Down Expand Up @@ -1133,6 +1133,7 @@ main(int argc, char **argv)
/* Initialise configuration */
notify_init();
spawn_init();
idnode_init();
config_init(opt_nobackup == 0);

/* Memoryinfo */
Expand Down

0 comments on commit 1681799

Please sign in to comment.