1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

More comments in threads.c

* libguile/threads.c (struct scm_mutex): Better comments.
This commit is contained in:
Andy Wingo 2016-11-13 15:55:58 +01:00
parent e0f17417e6
commit 9ac2c9942b

View file

@ -1061,9 +1061,13 @@ enum scm_mutex_kind {
struct scm_mutex { struct scm_mutex {
scm_i_pthread_mutex_t lock; scm_i_pthread_mutex_t lock;
/* The thread that owns this mutex, or #f if the mutex is unlocked. */
SCM owner; SCM owner;
int level; /* how much the owner owns us. <= 1 for non-recursive mutexes */ /* Queue of threads waiting for this mutex. */
SCM waiting; /* the 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) #define SCM_MUTEXP(x) SCM_SMOB_PREDICATE (scm_tc16_mutex, x)