mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 22:29:23 +00:00
[lib/cleanup] Use a typedef for the thread type
* lib/thread.{c,h}: As per subject. This will avoid head-scratching for next person who adds a thread-type and gets strange breakage.
This commit is contained in:
parent
bd24624252
commit
41b2373cec
@ -269,7 +269,7 @@ cpu_record_hash_print(struct hash_backet *bucket,
|
|||||||
{
|
{
|
||||||
struct cpu_thread_history *totals = args[0];
|
struct cpu_thread_history *totals = args[0];
|
||||||
struct vty *vty = args[1];
|
struct vty *vty = args[1];
|
||||||
unsigned char *filter = args[2];
|
thread_type *filter = args[2];
|
||||||
struct cpu_thread_history *a = bucket->data;
|
struct cpu_thread_history *a = bucket->data;
|
||||||
|
|
||||||
a = bucket->data;
|
a = bucket->data;
|
||||||
@ -288,7 +288,7 @@ cpu_record_hash_print(struct hash_backet *bucket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cpu_record_print(struct vty *vty, unsigned char filter)
|
cpu_record_print(struct vty *vty, thread_type filter)
|
||||||
{
|
{
|
||||||
struct cpu_thread_history tmp;
|
struct cpu_thread_history tmp;
|
||||||
void *args[3] = {&tmp, vty, &filter};
|
void *args[3] = {&tmp, vty, &filter};
|
||||||
@ -323,7 +323,7 @@ DEFUN(show_thread_cpu,
|
|||||||
"Display filter (rwtexb)\n")
|
"Display filter (rwtexb)\n")
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned char filter = 0xff;
|
thread_type filter = (thread_type) -1U;
|
||||||
|
|
||||||
if (argc > 0)
|
if (argc > 0)
|
||||||
{
|
{
|
||||||
|
@ -57,11 +57,13 @@ struct thread_master
|
|||||||
unsigned long alloc;
|
unsigned long alloc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef unsigned char thread_type;
|
||||||
|
|
||||||
/* Thread itself. */
|
/* Thread itself. */
|
||||||
struct thread
|
struct thread
|
||||||
{
|
{
|
||||||
unsigned char type; /* thread type */
|
thread_type type; /* thread type */
|
||||||
unsigned char add_type; /* thread type */
|
thread_type add_type; /* thread type */
|
||||||
struct thread *next; /* next pointer of the thread */
|
struct thread *next; /* next pointer of the thread */
|
||||||
struct thread *prev; /* previous pointer of the thread */
|
struct thread *prev; /* previous pointer of the thread */
|
||||||
struct thread_master *master; /* pointer to the struct thread_master. */
|
struct thread_master *master; /* pointer to the struct thread_master. */
|
||||||
@ -89,7 +91,7 @@ struct cpu_thread_history
|
|||||||
#ifdef HAVE_RUSAGE
|
#ifdef HAVE_RUSAGE
|
||||||
struct time_stats cpu;
|
struct time_stats cpu;
|
||||||
#endif
|
#endif
|
||||||
unsigned char types;
|
thread_type types;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Clocks supported by Quagga */
|
/* Clocks supported by Quagga */
|
||||||
|
Loading…
Reference in New Issue
Block a user