Changeset 17296


Ignore:
Timestamp:
10/21/13 14:11:58 (11 years ago)
Author:
lyard
Message:
Gave the possibility to change the number of threads, as long as nothing has been written to the file yet
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zofits.h

    r17295 r17296  
    378378
    379379        /// Shrinks a catalog that is too long to fit into the reserved space at the beginning of the file.
    380         uint32_t ShrinkCatalog()
     380        const uint32_t ShrinkCatalog()
    381381        {
    382382            //add empty row to get either the target number of rows, or a multiple of the allowed size
     
    564564        bool SetNumThreads(uint32_t num)
    565565        {
    566             if (is_open())
    567             {
    568 #ifdef __EXCEPTIONS
    569                 throw std::runtime_error("File must be closed before changing the number of compression threads");
     566            if (tellp()>0)
     567            {
     568#ifdef __EXCEPTIONS
     569                throw std::runtime_error("Number of threads cannot be changed in the middle of writing a file");
    570570#else
    571                 gLog << ___err___ << "ERROR - File must be closed before changing the number of compression threads" << std::endl;
     571                gLog << ___err___ << "ERROR - Number of threads cannot be changed in the middle of writing a file" << std::endl;
    572572#endif
    573573                return false;
Note: See TracChangeset for help on using the changeset viewer.