diff options
Diffstat (limited to 'vlib/vlib/threads.c')
-rw-r--r-- | vlib/vlib/threads.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c index 72f340ea205..302e201397b 100644 --- a/vlib/vlib/threads.c +++ b/vlib/vlib/threads.c @@ -77,6 +77,18 @@ os_get_cpu_number (void) return n; } +uword +os_get_ncpus (void) +{ + u32 len; + + len = vec_len (vlib_thread_stacks); + if (len == 0) + return 1; + else + return len; +} + void vlib_set_thread_name (char *name) { |