guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 08/08: More comments in threads.c


From: Andy Wingo
Subject: [Guile-commits] 08/08: More comments in threads.c
Date: Sun, 13 Nov 2016 14:58:54 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit 9ac2c9942b75d3e891ae8eabc219b68bfdf61f9c
Author: Andy Wingo <address@hidden>
Date:   Sun Nov 13 15:55:58 2016 +0100

    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 f4388ce..262e2ed 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]