Changeset 3392 in Sophya for trunk/SophyaLib/HiStats/swppfdtable.cc
- Timestamp:
- Nov 22, 2007, 7:25:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/swppfdtable.cc
r3031 r3392 1 1 #include "swppfdtable.h" 2 #include "sopnamsp.h"3 2 #include "pexceptions.h" 4 3 #include "thsafeop.h" 4 5 namespace SOPHYA { 5 6 6 7 /*! 7 \class S OPHYA::SwPPFDataTable8 \class SwPPFDataTable 8 9 \ingroup HiStats 9 10 This class can be used to organize data in table (row-column) form. … … 96 97 } 97 98 98 //! copy constructor - shares the data 99 //! copy constructor - shares the data (and copies the thread safety state) 100 99 101 SwPPFDataTable::SwPPFDataTable(SwPPFDataTable const & a) 100 102 : BaseDataTable(a.SegmentSize()), … … 137 139 // On copie la structure de table 138 140 CopyStructure(a); 141 if (a.IsThreadSafe()) SetThreadSafe(true); 142 else SetThreadSafe(false); 139 143 140 144 // … … 229 233 if (mInfo) delete mInfo; 230 234 mInfo = NULL; 235 if (mThS) delete mThS; 236 mThS = NULL; 231 237 mMin.clear(); 232 238 mMax.clear(); … … 355 361 // On est oblige de calculer les min-max lors du remplissage 356 362 // On ne peut pas en effet 'relire' le swap pendant l'ecriture 363 if (mThS) mThS->lock(); // tread-safety 357 364 for(sa_size_t k=0; k<NVar(); k++) { 358 365 double x = data[k]; … … 361 368 mMinMaxNEnt[k]++; 362 369 } 370 if (mThS) mThS->unlock(); // tread-safety 363 371 return BaseDataTable::AddRow(data); 364 372 } … … 373 381 // On est oblige de calculer les min-max lors du remplissage 374 382 // On ne peut pas en effet 'relire' le swap pendant l'ecriture 383 if (mThS) mThS->lock(); // tread-safety 375 384 for(sa_size_t k=0; k<NVar(); k++) { 376 385 double x = (double)data[k]; … … 379 388 mMinMaxNEnt[k]++; 380 389 } 390 if (mThS) mThS->unlock(); // tread-safety 381 391 return BaseDataTable::AddRow(data); 382 392 } … … 394 404 return AddRow(data.MTVPtr()); 395 405 } 406 407 } // FIN namespace SOPHYA
Note:
See TracChangeset
for help on using the changeset viewer.