summaryrefslogtreecommitdiffstats
path: root/byterun/io.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1996-04-01 15:24:38 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1996-04-01 15:24:38 +0000
commit3b99a2c8d5c0aec40323e725b4fe28b4f3953344 (patch)
tree008f3c37ed9abb0c257fc794c64f318897647cef /byterun/io.c
parent3b91622e5db25564b9e8f48ef4a4260fab0b1396 (diff)
Changement du format pour intern/extern.
Pour les threads, adaptation des I/O a la possibilite d'un GC des qu'on fait enter_blocking_section. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/io.c')
-rw-r--r--byterun/io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/byterun/io.c b/byterun/io.c
index 342dd6896..e1abf3014 100644
--- a/byterun/io.c
+++ b/byterun/io.c
@@ -86,6 +86,8 @@ static void really_write(fd, p, n)
int n;
{
int retcode;
+ Assert(!Is_young(p));
+ enter_blocking_section();
while (n > 0) {
#ifdef HAS_UI
retcode = ui_write(fd, p, n);
@@ -100,6 +102,7 @@ static void really_write(fd, p, n)
p += retcode;
n -= retcode;
}
+ leave_blocking_section();
}
value flush(channel) /* ML */
@@ -227,6 +230,7 @@ static int really_read(fd, p, n)
{
int retcode;
+ Assert(!Is_young(p));
enter_blocking_section();
#ifdef HAS_UI
retcode = ui_read(fd, p, n);