1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-04 14:00:18 +02:00
Commit graph

2151 commits

Author SHA1 Message Date
Gary Houston
67fe060ed5 * ports.c (scm_add_to_port_table): allocate in units of
struct scm_port_table *, not struct scm_port_table.
	* posix.c (scm_close_pipe): remove the port from the port table
	and mark as closed.
	Thanks to Rob Engle for both fixes.
1998-03-03 10:11:13 +00:00
Mark Galassi
186d31e78c minor: remove some commented out old code 1998-03-01 07:25:59 +00:00
Mikael Djurfeldt
d90ca38d06 * iselect.h, iselect.c, coop.c, coop-threads.c, coop-threads.h,
coop-defs.h, throw.c, backtrace.c: Added new copyright year 1998.
1998-02-06 18:55:29 +00:00
Mikael Djurfeldt
492960a4f4 * throw.h: Removed jmpbuf arg in scm_catch_body_t.
* backtrace.c (display_error_body, display_backtrace_body),
coop-threads.c (scheme_body_bootstrip, c_body_bootstrip),
gh_eval.c (eval_str_wrapper, eval_file_wrapper), init.c
(invoke_main_func), root.c (cwdr_body), throw.c (cwss_body,
scm_body_thunk, hbpca_body): Removed the second jmpbuf arg on body
functions.

* throw.c (scm_internal_catch, scm_internal_lazy_catch): Bodies
don't receive the jmpbuf arg anylonger.
(scm_catch): Don't accept a #f tag.
(scm_throw): Check that key is a symbol.
(scm_ithrow): Don't take a jmpbuf as key.  Don't check key arg.
1998-02-02 15:00:59 +00:00
Mikael Djurfeldt
39752bec0a * backtrace.c (display_error_body, display_backtrace_body),
coop-threads.c (scheme_body_bootstrip, c_body_bootstrip),
gh_eval.c (eval_str_wrapper, eval_file_wrapper), init.c
(invoke_main_func), root.c (cwdr_body), throw.c (cwss_body,
scm_body_thunk, hbpca_body): Removed the second jmpbuf arg on body
functions.
1998-02-02 15:00:14 +00:00
Mikael Djurfeldt
660f41fa24 *** empty log message *** 1998-02-02 14:59:26 +00:00
Mikael Djurfeldt
318c2f6d96 *** empty log message *** 1998-02-01 21:05:14 +00:00
Mikael Djurfeldt
79a85e3b62 * async.c (async_pending): Removed declaration. 1998-01-31 13:30:10 +00:00
Mikael Djurfeldt
c69dfa6575 * coop.c, iselect.c: Since thread switches are now performed with
interrupts masked, we can't use the old mechanism of delivering
signals immediately when they arrive.  Signals must instead be
delivered when the asyncs run *after* the end of the critical
section in scm_internal_select.  But this also means after context
switch so that the signal will be delivered to a different thread.
To avoid this, I have changed the protocol of
coop_wait_for_runnable_thread and friends so that they are allowed
to return the original thread.  So, if a signal arrives during
scm_internal_select, we won't any longer be forced do a context
switch, but can remain in the same thread and deliver the signal
to it.

* iselect.c: Small fixes.
1998-01-30 21:08:26 +00:00
Mikael Djurfeldt
9cb5124fe3 * eval.c (scm_eval, scm_deval), eq.c (scm_equal_p): Use SCM_TICK
instead of SCM_ASYNC_TICK.
1998-01-30 21:07:51 +00:00
Mikael Djurfeldt
c2654ef0fa * dynwind.c (scm_wind_chain): New debug function. 1998-01-30 21:07:14 +00:00
Mikael Djurfeldt
d186aac642 * coop.c, iselect.c: Since thread switches are now performed with
interrupts masked, we can't use the old mechanism of delivering
signals immediately when they arrive.  Signals must instead be
delivered when the asyncs run *after* the end of the critical
section in scm_internal_select.  But this also means after context
switch so that the signal will be delivered to a different thread.
To avoid this, I have changed the protocol of
coop_wait_for_runnable_thread and friends so that they are allowed
to return the original thread.  So, if a signal arrives during
scm_internal_select, we won't any longer be forced do a context
switch, but can remain in the same thread and deliver the signal
to it.

* coop.c (coop_mutex_init, coop_mutex_lock, coop_mutex_unlock,
coop_condition_variable_init, coop_condition_variable_wait,
coop_condition_variable_signal): Changed return type from `void'
to `int'.  This is to adhere closer to the pthreads interface.
This, in turn, is part of an attempt to provide C versions of the
mutex and condition variable primitives which can be part of a
frontend to COOP or pthreads.

* coop.c (coop_mutex_destroy, coop_condition_variable_wait_mutex,
coop_condition_variable_destroy): New functions.
1998-01-30 21:07:00 +00:00
Mikael Djurfeldt
0a1a92ab64 * coop-threads.c (scheme_launch_data, scheme_body_bootstrip,
scheme_handler_bootstrip, scheme_launch_thread, c_launch_data,
c_body_bootstrip, c_handler_bootstrip, c_launch_thread): Add an
extra layer of functions around the body and handler of a thread.
This extra layer makes sure that the handler is called in the
dynamic context of the surround (= empty dynwind list), but under
the *dynamic root* of the body.  We can not use the dynamic root
of the surround since that root belongs to another thread => stack
is not handled correctly.  It may seem ugly to use this extra
layer, but the extra cost in terms of execution time is really
negligible compared to the total amount of time required to create
a thread, and it would reduce maintainability to duplicate the
crucial and complicated steps performed by cwdr.

* coop-threads.c (scm_wait_condition_variable): Use
coop_condition_variable_wait_mutex.
1998-01-30 21:06:47 +00:00
Mikael Djurfeldt
5e569ca831 * async.c, async.h (asyncs_pending): Renamed asyncs_pending -->
scm_asyncs_pending and made it global.
1998-01-30 21:06:31 +00:00
Mikael Djurfeldt
c72cc5fbe4 * __scm.h (SCM_ASYNC_TICK): Removed thread switching code.
(SCM_ALLOW_INTS): Added thread switching code before interrupts
get re-enabled.  The important effect of this is that interrupts
are blocked during thread switching so that thread data structures
don't risk getting messed up by an unfortunate signal.
(SCM_REDEFER_INTS, SCM_REALLOW_INTS): It turned out that gcc-2.8.0
seems to do more aggressive optimization which actually move
instructions around in these macros in a fatal way.  Therefore:
Introduce Anthony's SCM_FENCE macro!  (And I who thought he was
just superstitious...)
(SCM_TICK): Maybe do a context switch and take care of asyncs.
This macro should be used instead of SCM_ASYNC_TICK since the
latter doesn't do context switches any more.
1998-01-30 21:06:16 +00:00
Mikael Djurfeldt
13dc0cae2f * threads.scm: Added simple error and signal handler.
(make-thread, begin-handler): Use this handler.  The most
important effect of this is that signals get unmasked.
Previously, when a signal was thrown signals remained masked
(signals get masked when a signal is taken) which influenced other
threads.
1998-01-30 21:05:53 +00:00
Mikael Djurfeldt
a3ec616e42 Small fix to scm_getc: Move FD_ZERO into the select loop 1998-01-30 21:02:36 +00:00
Mikael Djurfeldt
6905611f41 *** empty log message *** 1998-01-26 01:43:43 +00:00
Mikael Djurfeldt
c8bf4ecd10 * coop.c (coop_mutex_init, coop_mutex_lock, coop_mutex_unlock,
coop_condition_variable_init, coop_condition_variable_wait,
coop_condition_variable_signal): Changed return type from `void'
to `int'.  This is to adhere closer to the pthreads interface.
This, in turn, is part of an attempt to provide C versions of the
mutex and condition variable primitives which can be part of a
frontend to COOP or pthreads.

* coop.c (coop_mutex_destroy, coop_condition_variable_wait_mutex,
coop_condition_variable_destroy): New functions.

* coop-threads.c (scm_wait_condition_variable): Use
coop_condition_variable_wait_mutex.

* coop-threads.h, coop-defs.h (coop_q_t, coop_m, coop_c):
Definitions moved to coop-defs.h.

* coop-defs.h (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock,
scm_mutex_destroy, scm_cond_init, scm_cond_wait, scm_cond_signal,
scm_cond_destroy): New C interface to mutecis and cond vars.
1998-01-26 01:43:16 +00:00
Mikael Djurfeldt
3237b129f7 * iselect.c: Small fixes. 1998-01-26 01:42:43 +00:00
Mikael Djurfeldt
3d9352fb80 * error.c (scm_wta): Added support for SCM_ARG6 and SCM_ARG7. 1998-01-25 12:00:47 +00:00
Mikael Djurfeldt
a48b6916e2 * iselect.c: Now several threads can wait on the same file
descriptor.  The behaviour is compatible with OS select: All
threads waiting for the fd return with the same status.
1998-01-24 01:50:43 +00:00
Mikael Djurfeldt
41fa950d83 Updated 1998-01-24 01:49:01 +00:00
Mikael Djurfeldt
df366c2615 * coop-threads.c, threads.h (scm_spawn_thread): New function.
Can spawn a thread from application C code.
1998-01-23 20:51:47 +00:00
Mikael Djurfeldt
171422a94a * gh.h, gh_data.c (gh_doubles2scm, gh_doubles2dvect,
gh_doubles2scm): New functions.
1998-01-20 18:03:18 +00:00
Mikael Djurfeldt
f3a2c4cfe6 * gh.h, gh_data.c (gh_doubles2scm, gh_doubles2dvect,
gh_doubles2scm): New functions.
1998-01-20 17:57:01 +00:00
Jim Blandy
e1b6c71093 *** empty log message *** 1998-01-19 21:22:13 +00:00
Mark Galassi
770827b0f0 some trivial cleanup 1998-01-16 00:32:28 +00:00
Jim Blandy
0543c9b780 Fixed copyright notice on complex transcendental functions. Jerry
Hedden assigned the copyright to the FSF a while ago.
1998-01-05 22:10:10 +00:00
Tim Pierce
110611ddcc New file. 1998-01-05 08:29:54 +00:00
Gary Houston
ef9ff3fd0a * socket.c (scm_bind): free soka after use.
* stime.c (tzvar): new variable.
	(setzone, restorezone, scm_localtime, scm_mktime, scm_strftime):
	avoid memory leaks when allocating.
1998-01-04 02:50:12 +00:00
Jim Blandy
7a35faf841 *** empty log message *** 1998-01-04 00:31:25 +00:00
Jim Blandy
ab256d3909 * gc.c, tags.h: Doc fixes. 1998-01-04 00:31:13 +00:00
Jim Blandy
bb3b902f56 * iselect.h: Some systems require <sys/types.h> to get the FD_SET
macro definitions.
1998-01-04 00:31:05 +00:00
Jim Blandy
e7c5fb3770 Doc fix. 1998-01-04 00:09:54 +00:00
Mikael Djurfeldt
b971e6c65c * eval.c (macro-eval!): Removed. This function was a design bug.
It allowed memoized code to leak out to the scheme level.  Most
things that you could do with `macro-eval!' can be done with
`local-eval'.
1998-01-02 16:44:05 +00:00
Mikael Djurfeldt
29521173a0 macro-eval! removed 1998-01-02 16:43:37 +00:00
Tim Pierce
841d28d736 A better fix to the SLIB identity problem -- thanks to Marius Vollmer.
* slib.scm (identity): Unmake public.
	(slib:eval): Evaluate inside `slib-module'.
1998-01-02 03:36:36 +00:00
Tim Pierce
249cdba61b Changes for SLIB compatibility. 1997-12-26 02:59:08 +00:00
Tim Pierce
ad76c8d972 Bring slib.scm up to date with current SLIB release, hopefully. 1997-12-24 06:10:47 +00:00
Tim Pierce
377474477c * fports.c (scm_pipob): Use scm_generic_fgets for line i/o, since
scm_fgets now depends on ftell(3) to know how many bytes were
	read.  Sigh.
1997-12-20 13:52:09 +00:00
Tim Pierce
66d1e129c9 * gh_data.c (gh_scm2newstr, gh_get_substr): Use RO macros for
dealing with strings.
1997-12-16 05:09:50 +00:00
Tim Pierce
848f2a0114 boot-9.scm (read-line): Rewritten to use %read-line.
ioext.c (%read-line): Return a cons of the input line and its terminator.
fports.c, genio.c, genio.h, ports.c, ports.h: Change fgets methods
	to return the string length as well as its contents.
1997-12-13 08:33:33 +00:00
Mikael Djurfeldt
cafc12ffdd * filesys.c (set_element): Return file descriptor.
(fill_select_type): Return the highest file descriptor.
(scm_select): Tell select about the highest file descriptor.  On
some systems the SELECT_SET_SIZE can be as much as 128 bytes.
Therefore the extra overhead for calculating the maximum fd seems
to be more than compensated.  Is this correct?  In any case,
scm_internal_select will be much faster with this info.
(scm_select, fill_select_type, set_element): Don't accept any kind
of object in the file descriptor list or vector.
1997-12-08 18:15:44 +00:00
Gary Houston
341eaef04b * README: using Automake 1.2d
* configure.in: AC_CHECK_FUNCS: add "system".
	* simpos.c (scm_system): always define: use sysmissing if not
	available.  Check for HAVE_SYSTEM instead of _Windows (does
	Windows lack system or does it have an unusable one?).
	Check for error conditions -1 and 127.  Use SCM_DEFER_INTS.
	Let the argument be optional: if not supplied, call system(NULL).
	* ports.c (scm_close_port): relax the type check from OPPORTP to
	PORTP; closing a closed port is allowed.
1997-12-07 07:02:17 +00:00
Tim Pierce
8122b543c1 * fports.c (scm_fgets): Return if the last char in a chunk is
newline.  When fgets returns a string whose length is `size-1', it
	is ambiguous whether a whole line was retrieved, so we must check
	explicitly whether a line terminator is present.
1997-12-04 19:05:05 +00:00
Mikael Djurfeldt
1ea4704837 * filesys.c (scm_stat): Slightly optimized. 1997-12-04 16:40:53 +00:00
Mikael Djurfeldt
bfc471e7a1 * print.h (SCM_COERCE_OUTPORT): Check that the object is a pair
before taking the CDR.
1997-12-04 16:18:59 +00:00
Mikael Djurfeldt
380463881a * filesys.c (scm_stat): Coerce output port only if argument *is*
an output port!  (Thanks to Harald Meland.)
1997-12-04 16:03:58 +00:00
Jim Blandy
1d16e405be *** empty log message *** 1997-12-03 17:31:51 +00:00