diff options
Diffstat (limited to 'src/libnetdata/string')
-rw-r--r-- | src/libnetdata/string/string.c | 5 | ||||
-rw-r--r-- | src/libnetdata/string/string.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libnetdata/string/string.c b/src/libnetdata/string/string.c index 94c11f4b..257a3cc4 100644 --- a/src/libnetdata/string/string.c +++ b/src/libnetdata/string/string.c @@ -702,3 +702,8 @@ int string_unittest(size_t entries) { fprintf(stderr, "\n%zu errors found\n", errors); return errors ? 1 : 0; } + +void string_init(void) { + for (size_t i = 0; i != STRING_PARTITIONS; i++) + rw_spinlock_init(&string_base[i].spinlock); +} diff --git a/src/libnetdata/string/string.h b/src/libnetdata/string/string.h index f2ff9666..c44696be 100644 --- a/src/libnetdata/string/string.h +++ b/src/libnetdata/string/string.h @@ -34,4 +34,6 @@ void string_statistics(size_t *inserts, size_t *deletes, size_t *searches, size_ int string_unittest(size_t entries); +void string_init(void); + #endif |