port locking refactor
authorAndy Wingo <wingo@pobox.com>
Tue, 6 Dec 2011 12:50:05 +0000 (13:50 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 6 Dec 2011 17:01:45 +0000 (18:01 +0100)
commit92c0ebac90439a90b7acc33f3c44f5adf470d8c9
treeef2750edb63da0f6df7622f3c94c8e595f1b7f06
parentea0582c283c29e40f1eb1e85821a9c46bc386121
port locking refactor

* libguile/ports.h (struct scm_t_port): Make the lock into a pointer
  field instead of an inline field.  It should be possible to make
  unlocked ports by having a NULL lock field.
  (scm_c_lock_port, scm_c_try_lock_port): Return the mutex if the port
  was actually locked.
  (scm_c_unlock_port): Remove.

* libguile/ports.c (scm_c_make_port_with_encoding): For now, leave
  `lock' set to 0.
  Change scm_c_lock_port callers to pay attention to the new API.

* libguile/print.c (scm_write, scm_display): Fix call to
  dynwind-lock-port for ports-with-print-states.
libguile/ports.c
libguile/ports.h
libguile/print.c