Commit Graph

22 Commits (c3f6cd7ff7d53a1b97651ad59d2c0c81f98751a8)

Author SHA1 Message Date
Stephen Dolan 15b9d006a4 Avoid polling in caml_leave_blocking_section
To preserve behaviour, explicit polls are added:

   - in caml_raise, to raise the right exception when as system
     call is interrupted by a signal.

   - in sigprocmask, to ensure that signals are handled as soon
     as they are unmasked.
2020-07-28 10:54:54 +01:00
Jacques-Henri Jourdan 08ed1e85cd Fix Thread.sigmask, take 2 (#2211)
Fix Thread.sigmaks, by checking whether a signal is masked before handling it.

We use [sigprocmask] (if available) to check whether a signal is
blocked when the systhread library is not loaded. As soon as the
[Thread] module gets loaded, we use [pthread_sigmask] instead, and
redirect all the calls to [sigprocmask] to [pthread_sigmask].  Indeed,
the latter has unspecified behavior in a multi-threaded context
anyway.  In practice, this should not change the semantics of
[Unix.sigprocmask] on Linux, since on this platform, [pthread_sigmask]
is actually an alias for [sigprocmask]. On MacOSX, the semantics will
change, since [sigprocmask] changes the masks of the whole process on
this platform.

Also, include [caml_pending_signals] in signals returned by
[Unix.sigpending]. Indeed, some signals might have been handled in the
POSIX sense by the C handler in the OCaml runtime, but not been
handled in the OCaml sense (for example, because they are blocked).

This commit un-reverts 1c82c481a, which has been reverted in
79eb572e4. The issues of the original commit are corrected in this commit.
2019-03-01 14:14:29 +01:00
David Allsopp 79eb572e42 Revert 1c82c481a5.
Problem with the test on macOS and FreeBSD + issue with downstream use
of signals_are_pending
2018-12-21 17:05:17 +01:00
Jacques-Henri Jourdan 1c82c481a5 Fix Thread.sigmaks, by checking whether a signal is masked before handling it.
We use [sigprocmask] (if available) to check whether a signal is blocked when
the systhread library is not loaded. When it gets loaded, we use
[pthread_sigmask] instead.

Also, include [caml_pending_signals] in signals returned by
[Unix.sigpending]. Indeed, some signals might have been handled in the
POSIX sense by the C handler in the OCaml runtime, but not been
handled in the OCaml sense (for example, because they are blocked).
2018-12-19 10:32:37 +00:00
ygrek 0589c0d1f7 unix: invalid_argument -> caml_invalid_argument 2016-11-26 16:47:22 -08:00
Sébastien Hinderer 13945a71ed Do not use the compatibility macros in the C stub code. (#892)
* Don't use the compatibility macros, neither in the C stub code nor in the testsuite.

* Make sure compiler sources do not use deprecated C identifiers.

This is achieved by ensuring that the CAML_NAME_SPACE macro is defined
everytime a C source file is compiled, rather than being defined only
in a few places. Defining this macro guarantees that the compatibility.h
header (where these deprecated identifiers are defined) will not be
included.
2016-11-17 11:03:09 +01:00
Fabrice Le Fessant 63a3924f47 Install all include files, and access internals with CAML_INTERNALS 2016-07-12 17:53:24 +02:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Gabriel Scherer 7ca29ef3f7 PR#5887: move the byterun/*.h headers to byterun/caml/*.h to avoid header name clashes
(Jérôme Vouillon and Adrien Nader and Peter Zotov)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-27 14:41:49 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Damien Doligez 9ea5edac9a merge changes 3.10.0 -> 3.10.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8768 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-01-11 16:13:18 +00:00
Damien Doligez e6007f6057 fusion des changements jusqu'a 3.08.3
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-03-24 17:20:54 +00:00
Xavier Leroy 7501784c80 MAJ en-tetes pour mentionner la 'special exception' sur la LGPL
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-12-07 13:41:02 +00:00
Xavier Leroy ddd99c7e5d Chargement dynamique de primitives C
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-08-28 14:47:48 +00:00
Xavier Leroy b1fa3c7002 Portage AIX 4.3
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2973 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-03-17 16:45:18 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Xavier Leroy c1b5a833e6 Ne pas oublier de passer en mode 'blocking section'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2378 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-06-05 13:27:54 +00:00
Xavier Leroy 51c55b2228 Revu la gestion des signaux et des exceptions dans les signal handlers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2377 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-06-05 12:02:48 +00:00
Damien Doligez 3be947947e nouvelles fonctions alloc/alloc_small
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2134 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-10-26 19:19:32 +00:00
Xavier Leroy 301a14f26d Proprification du traitement des numeros de signaux negatifs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2050 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-08-13 15:58:08 +00:00
Xavier Leroy ee699eec48 Ajout de sigprocmask, sigpending, sigsuspend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2040 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-08-08 16:53:42 +00:00