summaryrefslogtreecommitdiffstats
path: root/libio/streambuf.cc
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-09-16 16:01:55 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-09-16 16:01:55 +0000
commita6bb47e073377fa203132a3ae20f76103a8049b7 (patch)
tree6f133200943f818cad1e94da16393eadfe8dd250 /libio/streambuf.cc
parentdb3b49b1fef1f3ba83eeb6537963bd7884e89602 (diff)
downloadppe42-gcc-a6bb47e073377fa203132a3ae20f76103a8049b7.tar.gz
ppe42-gcc-a6bb47e073377fa203132a3ae20f76103a8049b7.zip
Uli's libio/libstdc++ patches.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15486 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libio/streambuf.cc')
-rw-r--r--libio/streambuf.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/libio/streambuf.cc b/libio/streambuf.cc
index 8f7908b8403..e87590f86d1 100644
--- a/libio/streambuf.cc
+++ b/libio/streambuf.cc
@@ -162,7 +162,7 @@ static _IO_pos_t _IO_sb_seekpos(_IO_FILE *fp, _IO_pos_t pos, int mode)
static int _IO_sb_pbackfail(_IO_FILE *fp, int ch)
{ return ((streambuf*)fp)->pbackfail(ch); }
-static void _IO_sb_finish(_IO_FILE *fp)
+static void _IO_sb_finish(_IO_FILE *fp, int)
{ ((streambuf*)fp)->~streambuf(); }
static _IO_ssize_t _IO_sb_read(_IO_FILE *fp, void *buf, _IO_ssize_t n)
{ return ((streambuf*)fp)->sys_read((char*)buf, n); }
@@ -207,13 +207,22 @@ struct _IO_jump_t _IO_streambuf_jumps = {
streambuf::streambuf(int flags)
{
+#ifdef _IO_MTSAFE_IO
+ _lock = new _IO_lock_t;
+#endif
_IO_init(this, flags);
#if !_IO_UNIFIED_JUMPTABLES
_jumps = &_IO_streambuf_jumps;
#endif
}
-streambuf::~streambuf() { _IO_default_finish(this,0); }
+streambuf::~streambuf()
+{
+ _IO_default_finish(this,0);
+#ifdef _IO_MTSAFE_IO
+ delete _lock;
+#endif
+}
streampos
streambuf::seekoff(streamoff, _seek_dir, int /*=ios::in|ios::out*/)
OpenPOWER on IntegriCloud