mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
manually merged
This commit is contained in:
@@ -689,12 +689,12 @@ extern pthread_t shutdown_th, main_th, signal_th;
|
||||
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
|
||||
#define thread_safe_sub(V,C,L) \
|
||||
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
|
||||
#if defined (__GNUC__) || defined (__cplusplus)
|
||||
static inline bool thread_safe_dec_and_test(ulong V, pthread_mutex_t *L)
|
||||
#ifdef __cplusplus
|
||||
static inline bool thread_safe_dec_and_test(ulong &V, pthread_mutex_t *L)
|
||||
{
|
||||
ulong res;
|
||||
pthread_mutex_lock(L);
|
||||
res=V--;
|
||||
res=--V;
|
||||
pthread_mutex_unlock(L);
|
||||
return res==0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user