namespace Msp {
namespace IO {
-Base::Base():
- mode(M_READ),
- eof_flag(false)
+Base::Base()
{ }
Base::~Base()
{
signal_deleted.emit();
+ delete mutex;
}
void Base::check_access(Mode m) const
if(eof_flag)
return false;
- while(1)
+ while(!eof())
{
int c = get();
if(c==-1 || c=='\n')
}
}
-const Handle &Base::get_handle(Mode)
+
+Base::Synchronize::Synchronize(Base &i):
+ io(i)
+{
+ if(!io.mutex)
+ io.mutex = new Mutex;
+ io.mutex->lock();
+}
+
+Base::Synchronize::~Synchronize()
{
- throw logic_error("Base::get_handle");
+ io.mutex->unlock();
}
} // namespace IO