GSF.IO.FileStructure.Media.DiskMedium.CommitChanges C# (CSharp) Method

CommitChanges() public method

Occurs when committing the following data to the disk. This will copy any pending data to the disk in a manner that will protect against corruption.
public CommitChanges ( FileHeaderBlock header ) : void
header FileHeaderBlock
return void
        public void CommitChanges(FileHeaderBlock header)
        {
            header.IsReadOnly = true;
            m_disk.CommitChanges(header);
            Thread.MemoryBarrier();
            m_header = header;
        }

Usage Example

Example #1
0
 /// <summary>
 /// Occurs when committing the following data to the disk.
 /// This will copy any pending data to the disk in a manner that
 /// will protect against corruption.
 /// </summary>
 /// <param name="header"></param>
 public void CommitChanges(FileHeaderBlock header)
 {
     if (m_disposed)
     {
         throw new ObjectDisposedException(GetType().FullName);
     }
     if (m_isReadOnly)
     {
         throw new ReadOnlyException();
     }
     m_stream.CommitChanges(header);
 }