diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-10-17 10:21:10 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-10-17 10:21:10 +0300 |
commit | eb1a9c646a2ad573ebe728d559c4403822881875 (patch) | |
tree | 037afc07e3644d8440402a35f8b253060c6ba718 /specific.c | |
parent | 85e3083ffcfce99717cd3a786dcab7c7911f6f43 (diff) | |
download | bdwgc-eb1a9c646a2ad573ebe728d559c4403822881875.tar.gz |
Check result of pthread_mutex_unlock in specific.c
* specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific,
GC_remove_specific_after_fork): Call ABORT if pthread_mutex_unlock()
fails.
Diffstat (limited to 'specific.c')
-rw-r--r-- | specific.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -72,7 +72,8 @@ GC_INNER int GC_setspecific(tsd * key, void * value) AO_store_release(&key->hash[hash_val].ao, (AO_t)entry); GC_dirty((/* no volatile */ void *)entry); GC_dirty(key->hash + hash_val); - pthread_mutex_unlock(&(key -> lock)); + if (pthread_mutex_unlock(&key->lock) != 0) + ABORT("pthread_mutex_unlock failed (setspecific)"); return 0; } @@ -128,7 +129,8 @@ GC_INNER void GC_remove_specific_after_fork(tsd * key, pthread_t t) /* With GC, we're done, since the pointers from the cache will */ /* be overwritten, all local pointers to the entries will be */ /* dropped, and the entry will then be reclaimed. */ - pthread_mutex_unlock(&(key -> lock)); + if (pthread_mutex_unlock(&key->lock) != 0) + ABORT("pthread_mutex_unlock failed (remove_specific after fork)"); } /* Note that even the slow path doesn't lock. */ |