mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-12 02:50:48 +00:00
Merge pull request #7109 from qlyoung/set-threadmaster-default-name
lib: set threadmaster name to 'default' if none
This commit is contained in:
commit
8fa28e23b5
@ -438,7 +438,8 @@ struct thread_master *thread_master_create(const char *name)
|
|||||||
pthread_cond_init(&rv->cancel_cond, NULL);
|
pthread_cond_init(&rv->cancel_cond, NULL);
|
||||||
|
|
||||||
/* Set name */
|
/* Set name */
|
||||||
rv->name = name ? XSTRDUP(MTYPE_THREAD_MASTER, name) : NULL;
|
name = name ? name : "default";
|
||||||
|
rv->name = XSTRDUP(MTYPE_THREAD_MASTER, name);
|
||||||
|
|
||||||
/* Initialize I/O task data structures */
|
/* Initialize I/O task data structures */
|
||||||
getrlimit(RLIMIT_NOFILE, &limit);
|
getrlimit(RLIMIT_NOFILE, &limit);
|
||||||
@ -449,10 +450,13 @@ struct thread_master *thread_master_create(const char *name)
|
|||||||
rv->write = XCALLOC(MTYPE_THREAD_POLL,
|
rv->write = XCALLOC(MTYPE_THREAD_POLL,
|
||||||
sizeof(struct thread *) * rv->fd_limit);
|
sizeof(struct thread *) * rv->fd_limit);
|
||||||
|
|
||||||
|
char tmhashname[strlen(name) + 32];
|
||||||
|
snprintf(tmhashname, sizeof(tmhashname), "%s - threadmaster event hash",
|
||||||
|
name);
|
||||||
rv->cpu_record = hash_create_size(
|
rv->cpu_record = hash_create_size(
|
||||||
8, (unsigned int (*)(const void *))cpu_record_hash_key,
|
8, (unsigned int (*)(const void *))cpu_record_hash_key,
|
||||||
(bool (*)(const void *, const void *))cpu_record_hash_cmp,
|
(bool (*)(const void *, const void *))cpu_record_hash_cmp,
|
||||||
"Thread Hash");
|
tmhashname);
|
||||||
|
|
||||||
thread_list_init(&rv->event);
|
thread_list_init(&rv->event);
|
||||||
thread_list_init(&rv->ready);
|
thread_list_init(&rv->ready);
|
||||||
|
Loading…
Reference in New Issue
Block a user