Trylock: return false if the lock is successfully acquired. */
| 175 | |
| 176 | /* Trylock: return false if the lock is successfully acquired. */ |
| 177 | static inline bool |
| 178 | malloc_mutex_trylock(tsdn_t *tsdn, malloc_mutex_t *mutex) { |
| 179 | witness_assert_not_owner(tsdn_witness_tsdp_get(tsdn), &mutex->witness); |
| 180 | if (isthreaded) { |
| 181 | if (malloc_mutex_trylock_final(mutex)) { |
| 182 | atomic_store_b(&mutex->locked, true, ATOMIC_RELAXED); |
| 183 | return true; |
| 184 | } |
| 185 | mutex_owner_stats_update(tsdn, mutex); |
| 186 | } |
| 187 | witness_lock(tsdn_witness_tsdp_get(tsdn), &mutex->witness); |
| 188 | |
| 189 | return false; |
| 190 | } |
| 191 | |
| 192 | /* Aggregate lock prof data. */ |
| 193 | static inline void |
no test coverage detected