From 9ac2c9942b75d3e891ae8eabc219b68bfdf61f9c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 13 Nov 2016 15:55:58 +0100 Subject: [PATCH] More comments in threads.c * libguile/threads.c (struct scm_mutex): Better comments. --- libguile/threads.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libguile/threads.c b/libguile/threads.c index f4388ce0e..262e2ed9d 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -1061,9 +1061,13 @@ enum scm_mutex_kind { struct scm_mutex { scm_i_pthread_mutex_t lock; + /* The thread that owns this mutex, or #f if the mutex is unlocked. */ SCM owner; - int level; /* how much the owner owns us. <= 1 for non-recursive mutexes */ - SCM waiting; /* the threads waiting for this mutex. */ + /* Queue of threads waiting for this mutex. */ + SCM waiting; + /* For SCM_MUTEX_RECURSIVE (and only SCM_MUTEX_RECURSIVE), the + recursive lock count. The first lock does not count. */ + int level; }; #define SCM_MUTEXP(x) SCM_SMOB_PREDICATE (scm_tc16_mutex, x)