diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-05 11:14:17 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-05 11:16:46 +0100 |
commit | 768246124164243059b0eeb772d3bb5bf1db0db9 (patch) | |
tree | e952dd839c0fe459e44c4c89f52273e24eed5a6b /libguile/deprecated.c | |
parent | c0916134ac052282ebd4353f2b9894e002cb4308 (diff) | |
download | guile-768246124164243059b0eeb772d3bb5bf1db0db9.tar.gz |
Replace scm_make_mutex_with_flags
* libguile/threads.c (enum fat_mutex_kind): New data type, replacing
separate flags.
(struct fat_mutex): Adapt.
(make_fat_mutex): Fat mutexes can only be one of three kinds, not one
of 4 kinds. (Recursive unowned mutexes are not a thing.)
(scm_make_mutex): Adapt.
(scm_make_mutex_with_kind): New function, replacing
scm_make_mutex_with_flags. Still bound to make-mutex.
(scm_make_recursive_mutex): Adapt.
(fat_mutex_lock, fat_mutex_unlock): Adapt.
* libguile/threads.h (scm_make_mutex_with_kind): New decl.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_mutex_with_flags): Deprecate.
Diffstat (limited to 'libguile/deprecated.c')
-rw-r--r-- | libguile/deprecated.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c index c8d353f89..fd671e9e5 100644 --- a/libguile/deprecated.c +++ b/libguile/deprecated.c @@ -680,6 +680,28 @@ scm_dynwind_critical_section (SCM mutex) +SCM +scm_make_mutex_with_flags (SCM flags) +{ + SCM kind = SCM_UNDEFINED; + + scm_c_issue_deprecation_warning + ("'scm_make_mutex_with_flags' is deprecated. " + "Use 'scm_make_mutex_with_kind' instead."); + + if (!scm_is_null (flags)) + { + if (!scm_is_null (scm_cdr (flags))) + scm_misc_error (NULL, "too many mutex options: ~a", scm_list_1 (flags)); + kind = scm_car (flags); + } + + return scm_make_mutex_with_kind (kind); +} + + + + void scm_i_init_deprecated () { |