diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /libports/port-deref-deferred.c | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2 hurd-835b293d35a209d38047126443d41fa7090daa4c.zip |
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating
errors much easier.
Diffstat (limited to 'libports/port-deref-deferred.c')
-rw-r--r-- | libports/port-deref-deferred.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libports/port-deref-deferred.c b/libports/port-deref-deferred.c index 2580e913..76373ebb 100644 --- a/libports/port-deref-deferred.c +++ b/libports/port-deref-deferred.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */ -#include <assert.h> +#include <assert-backtrace.h> #include <pthread.h> #include "ports.h" @@ -40,7 +40,7 @@ valid_color (unsigned int c) static inline unsigned int flip_color (unsigned int c) { - assert (valid_color (c)); + assert_backtrace (valid_color (c)); return ! c; } @@ -60,7 +60,7 @@ _ports_threadpool_init (struct ports_threadpool *pool) static inline void flip_generations (struct ports_threadpool *pool) { - assert (pool->old_threads == 0); + assert_backtrace (pool->old_threads == 0); pool->old_threads = pool->young_threads; pool->old_objects = pool->young_objects; pool->young_threads = 0; @@ -91,7 +91,7 @@ _ports_thread_quiescent (struct ports_threadpool *pool, struct ports_thread *thread) { struct pi_list *free_list = NULL, *p; - assert (valid_color (thread->color)); + assert_backtrace (valid_color (thread->color)); pthread_spin_lock (&pool->lock); if (thread->color == pool->color) @@ -123,7 +123,7 @@ void _ports_thread_offline (struct ports_threadpool *pool, struct ports_thread *thread) { - assert (valid_color (thread->color)); + assert_backtrace (valid_color (thread->color)); retry: pthread_spin_lock (&pool->lock); @@ -154,7 +154,7 @@ _ports_port_deref_deferred (struct port_info *pi) pool->young_objects = pl; if (pool->old_threads == 0) { - assert (pool->old_objects == NULL); + assert_backtrace (pool->old_objects == NULL); flip_generations (pool); } pthread_spin_unlock (&pool->lock); |