diff options
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/locks/locks.h (renamed from libnetdata/locks/locks.h) | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libnetdata/locks/locks.h b/src/libnetdata/locks/locks.h index 6b492ae47..d3873c295 100644 --- a/libnetdata/locks/locks.h +++ b/src/libnetdata/locks/locks.h @@ -25,6 +25,10 @@ void spinlock_lock(SPINLOCK *spinlock); void spinlock_unlock(SPINLOCK *spinlock); bool spinlock_trylock(SPINLOCK *spinlock); +void spinlock_lock_cancelable(SPINLOCK *spinlock); +void spinlock_unlock_cancelable(SPINLOCK *spinlock); +bool spinlock_trylock_cancelable(SPINLOCK *spinlock); + typedef struct netdata_rw_spinlock { int32_t readers; SPINLOCK spinlock; @@ -102,13 +106,11 @@ int __netdata_rwlock_destroy(netdata_rwlock_t *rwlock); int __netdata_rwlock_init(netdata_rwlock_t *rwlock); int __netdata_rwlock_rdlock(netdata_rwlock_t *rwlock); int __netdata_rwlock_wrlock(netdata_rwlock_t *rwlock); -int __netdata_rwlock_unlock(netdata_rwlock_t *rwlock); +int __netdata_rwlock_rdunlock(netdata_rwlock_t *rwlock); +int __netdata_rwlock_wrunlock(netdata_rwlock_t *rwlock); int __netdata_rwlock_tryrdlock(netdata_rwlock_t *rwlock); int __netdata_rwlock_trywrlock(netdata_rwlock_t *rwlock); -void netdata_thread_disable_cancelability(void); -void netdata_thread_enable_cancelability(void); - #ifdef NETDATA_TRACE_RWLOCKS int netdata_mutex_init_debug( const char *file, const char *function, const unsigned long line, netdata_mutex_t *mutex); @@ -121,7 +123,8 @@ int netdata_rwlock_destroy_debug( const char *file, const char *function, const int netdata_rwlock_init_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); int netdata_rwlock_rdlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); int netdata_rwlock_wrlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); -int netdata_rwlock_unlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); +int netdata_rwlock_rdunlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); +int netdata_rwlock_wrunlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); int netdata_rwlock_tryrdlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); int netdata_rwlock_trywrlock_debug( const char *file, const char *function, const unsigned long line, netdata_rwlock_t *rwlock); @@ -135,7 +138,8 @@ int netdata_rwlock_trywrlock_debug( const char *file, const char *function, cons #define netdata_rwlock_init(rwlock) netdata_rwlock_init_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) #define netdata_rwlock_rdlock(rwlock) netdata_rwlock_rdlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) #define netdata_rwlock_wrlock(rwlock) netdata_rwlock_wrlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) -#define netdata_rwlock_unlock(rwlock) netdata_rwlock_unlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) +#define netdata_rwlock_rdunlock(rwlock) netdata_rwlock_rdunlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) +#define netdata_rwlock_wrunlock(rwlock) netdata_rwlock_wrunlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) #define netdata_rwlock_tryrdlock(rwlock) netdata_rwlock_tryrdlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) #define netdata_rwlock_trywrlock(rwlock) netdata_rwlock_trywrlock_debug(__FILE__, __FUNCTION__, __LINE__, rwlock) @@ -151,7 +155,8 @@ int netdata_rwlock_trywrlock_debug( const char *file, const char *function, cons #define netdata_rwlock_init(rwlock) __netdata_rwlock_init(rwlock) #define netdata_rwlock_rdlock(rwlock) __netdata_rwlock_rdlock(rwlock) #define netdata_rwlock_wrlock(rwlock) __netdata_rwlock_wrlock(rwlock) -#define netdata_rwlock_unlock(rwlock) __netdata_rwlock_unlock(rwlock) +#define netdata_rwlock_rdunlock(rwlock) __netdata_rwlock_rdunlock(rwlock) +#define netdata_rwlock_wrunlock(rwlock) __netdata_rwlock_wrunlock(rwlock) #define netdata_rwlock_tryrdlock(rwlock) __netdata_rwlock_tryrdlock(rwlock) #define netdata_rwlock_trywrlock(rwlock) __netdata_rwlock_trywrlock(rwlock) |