Changeset 3391 in Sophya for trunk/SophyaExt
- Timestamp:
- Nov 22, 2007, 7:23:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/swfitsdtable.cc
r3069 r3391 1 1 #include "swfitsdtable.h" 2 2 #include "fitshdtable.h" 3 #include "sopnamsp.h"4 3 #include "pexceptions.h" 5 4 #include "thsafeop.h" 5 6 namespace SOPHYA { 6 7 7 8 /*! 8 \class S OPHYA::SwFitsDataTable9 \class SwFitsDataTable 9 10 \ingroup FitsIOServer 10 11 This class can be used to organize data in table (row-column) form. … … 101 102 } 102 103 103 //! copy constructor - shares the data 104 //! copy constructor - shares the data (and copies the thread safety state) 104 105 SwFitsDataTable::SwFitsDataTable(SwFitsDataTable const & a) 105 106 : BaseDataTable(a.SegmentSize()), … … 130 131 // On copie la structure de table 131 132 CopyStructure(a); 133 if (a.IsThreadSafe()) SetThreadSafe(true); 134 else SetThreadSafe(false); 132 135 133 136 // … … 223 226 if (mInfo) delete mInfo; 224 227 mInfo = NULL; 228 if (mThS) delete mThS; 229 mThS = NULL; 230 225 231 mMin.clear(); 226 232 mMax.clear(); … … 403 409 sa_size_t SwFitsDataTable::AddRow(const r_8* data) 404 410 { 411 if (mThS) mThS->lock(); // tread-safety 405 412 if (NRows() == 0) { // On cree la definition de la table FITS au premier appel 406 413 FitsHandler<BaseDataTable> fio(*this); … … 415 422 mMinMaxNEnt[k]++; 416 423 } 424 if (mThS) mThS->unlock(); // tread-safety 417 425 return BaseDataTable::AddRow(data); 418 426 } … … 426 434 sa_size_t SwFitsDataTable::AddRow(const MuTyV * data) 427 435 { 436 if (mThS) mThS->lock(); // tread-safety 428 437 if (NRows() == 0) { // On cree la definition de la table FITS au premier appel 429 438 FitsHandler<BaseDataTable> fio(*this); … … 438 447 mMinMaxNEnt[k]++; 439 448 } 449 if (mThS) mThS->unlock(); // tread-safety 440 450 return BaseDataTable::AddRow(data); 441 451 } … … 453 463 return AddRow(data.MTVPtr()); 454 464 } 465 466 } // FIN namespace SOPHYA
Note:
See TracChangeset
for help on using the changeset viewer.