diff options
author | Andy Wingo <wingo@pobox.com> | 2016-04-28 08:34:08 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-04-28 08:34:08 +0200 |
commit | 2b47043052565eb780ef5600e4968fc333643b0c (patch) | |
tree | 435e3a0e2d8edde84822e30d4508a6934f930f05 /libguile/ports.h | |
parent | 8b46a4af446d2015976b1d9c09888a75260ebc2b (diff) | |
download | guile-2b47043052565eb780ef5600e4968fc333643b0c.tar.gz |
Remove port locks
* libguile/ports.h (scm_t_port): Remove lock field.
(scm_dynwind_lock_port, scm_c_lock_port, scm_c_try_lock_port):
Remove.
* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
Remove locking.
* libguile/ports.c (scm_c_make_port_with_encoding): Remove lock.
(scm_i_read_bytes, scm_i_read, scm_i_write_bytes, scm_i_write): Remove
"_unlocked" from names and adapt callers.
Diffstat (limited to 'libguile/ports.h')
-rw-r--r-- | libguile/ports.h | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/libguile/ports.h b/libguile/ports.h index d88fb21bd..230137f68 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -84,9 +84,6 @@ typedef struct /* Link back to the port object. */ SCM port; - /* A recursive lock for this port. */ - scm_i_pthread_mutex_t *lock; - /* Pointer to internal-only port structure. */ struct scm_port_internal *internal; @@ -289,11 +286,6 @@ SCM_API SCM scm_set_port_encoding_x (SCM port, SCM encoding); SCM_API SCM scm_port_conversion_strategy (SCM port); SCM_API SCM scm_set_port_conversion_strategy_x (SCM port, SCM behavior); -/* Acquiring and releasing the port lock. */ -SCM_API void scm_dynwind_lock_port (SCM port); -SCM_INLINE int scm_c_lock_port (SCM port, scm_i_pthread_mutex_t **lock); -SCM_INLINE int scm_c_try_lock_port (SCM port, scm_i_pthread_mutex_t **lock); - /* Input. */ SCM_API int scm_get_byte_or_eof (SCM port); SCM_API int scm_peek_byte_or_eof (SCM port); @@ -363,36 +355,6 @@ SCM_API SCM scm_sys_make_void_port (SCM mode); SCM_INTERNAL void scm_init_ports (void); -/* Inline function implementations. */ - -#if SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES -SCM_INLINE_IMPLEMENTATION int -scm_c_lock_port (SCM port, scm_i_pthread_mutex_t **lock) -{ - *lock = SCM_PTAB_ENTRY (port)->lock; - - if (*lock) - return scm_i_pthread_mutex_lock (*lock); - else - return 0; -} - -SCM_INLINE_IMPLEMENTATION int -scm_c_try_lock_port (SCM port, scm_i_pthread_mutex_t **lock) -{ - *lock = SCM_PTAB_ENTRY (port)->lock; - if (*lock) - { - int ret = scm_i_pthread_mutex_trylock (*lock); - if (ret != 0) - *lock = NULL; - return ret; - } - else - return 0; -} -#endif /* SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES */ - #endif /* SCM_PORTS_H */ /* |