diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-15 05:40:29 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-15 05:40:29 +0000 |
commit | 7fbaa0bedf29d6c44a3e038ec6dd9d153e4c7479 (patch) | |
tree | f49e21870ec9ca61a5ad5119a78b25bd7a832638 /io.c | |
parent | e78d4e69fe15b84358ce8fb30edf5c6610a6bad9 (diff) | |
download | ruby-7fbaa0bedf29d6c44a3e038ec6dd9d153e4c7479.tar.gz |
* io.c (finish_writeconv): uses rb_write_internal2 if
fptr->write_lock have.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3858,7 +3858,10 @@ finish_writeconv(rb_io_t *fptr, int noalloc) res = rb_econv_convert(fptr->writeconv, NULL, NULL, &dp, de, 0); while (dp-ds) { retry: - r = rb_write_internal(fptr->fd, ds, dp-ds); + if (fptr->write_lock && rb_mutex_owned_p(fptr->write_lock)) + r = rb_write_internal2(fptr->fd, ds, dp-ds); + else + r = rb_write_internal(fptr->fd, ds, dp-ds); if (r == dp-ds) break; if (0 <= r) { |