* include/ruby/io.h (rb_io_t): added write_lock to serialize.

[ruby-core:19668]

* gc.c (gc_mark_children): mark write_lock.

* gc.c (rb_gc_call_finalizer_at_exit): Mutex also needs to be
  deferred.

* io.c (io_fflush, io_binwrite, fptr_finalize): serializes writing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-11-07 20:47:02 +00:00
parent f8cdd9907a
commit 551dfe9d8b
4 changed files with 89 additions and 21 deletions

View file

@ -73,6 +73,7 @@ typedef struct rb_io_t {
VALUE writeconv_pre_ecopts;
int writeconv_initialized;
VALUE write_lock;
} rb_io_t;
#define HAVE_RB_IO_T 1
@ -133,6 +134,7 @@ typedef struct rb_io_t {
fp->encs.enc2 = NULL;\
fp->encs.ecflags = 0;\
fp->encs.ecopts = Qnil;\
fp->write_lock = 0;\
} while (0)
FILE *rb_io_stdio_file(rb_io_t *fptr);