Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/lib/common/logging.cxx
ViewVC logotype

Diff of /branches/vis15/src/lib/common/logging.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4857, Wed Dec 28 15:24:42 2016 UTC revision 4858, Thu Dec 29 15:35:00 2016 UTC
# Line 75  Line 75 
75            // write the header block            // write the header block
76              this->_ofs.write (reinterpret_cast<const char *>(&hdr), sizeof(hdr));              this->_ofs.write (reinterpret_cast<const char *>(&hdr), sizeof(hdr));
77              this->_ofs.flush ();              this->_ofs.flush ();
78    
79              // initialize the mutex
80                pthread_mutex_init (&this->_lock, nullptr);
81          }          }
82    
83          file::~file ()          file::~file ()
# Line 98  Line 101 
101    
102          void file::output_buffer (buffer *buf)          void file::output_buffer (buffer *buf)
103          {          {
104                pthread_mutex_lock (&this->_lock);
105            // write the buffer to the output file            // write the buffer to the output file
106              this->_ofs.write (reinterpret_cast<const char *>(buf), sizeof(buffer));              this->_ofs.write (reinterpret_cast<const char *>(buf), sizeof(buffer));
107  // TODO: check for I/O error  // TODO: check for I/O error
108                pthread_mutex_unlock (&this->_lock);
109    
110            // reset buffer            // reset buffer
111              buf->_next = 0;              buf->_next = 0;
112              buf->_seqNum++;              buf->_seqNum++;

Legend:
Removed from v.4857  
changed lines
  Added in v.4858

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0