~ubuntu-branches/ubuntu/raring/djvulibre/raring

« back to all changes in this revision

Viewing changes to libdjvu/DataPool.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barak A. Pearlmutter
  • Date: 2008-04-07 09:58:58 UTC
  • Revision ID: james.westby@ubuntu.com-20080407095858-pmacpv5w1ua376cn
Tags: 3.5.20-7
* Generate djview transition package (closes: #473341)
* Postscript generation issue (four-color image into cpaldjvu into
  djvups without -mode=bw) seems to be resolved (closes: #278945)
* Remove djvudigital from djvulibre-bin (closes: #461226)
* Rewrite desktop package description (closes: #474689, #474700)

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
54
54
//C- +------------------------------------------------------------------
55
55
// 
56
 
// $Id: DataPool.cpp,v 1.14 2007/03/25 20:48:29 leonb Exp $
57
 
// $Name: debian_version_3_5_20-2 $
 
56
// $Id: DataPool.cpp,v 1.16 2008/03/05 00:37:23 leonb Exp $
 
57
// $Name: debian_version_3_5_20-7 $
58
58
 
59
59
#ifdef HAVE_CONFIG_H
60
60
# include "config.h"
835
835
 
836
836
  clear_stream(true);
837
837
  if (furl.is_local_file_url())
838
 
  {
839
 
    FCPools::get()->del_pool(furl, this);
840
 
  }
841
 
   
 
838
    if (this->get_count() > 1)
 
839
      FCPools::get()->del_pool(furl, this);
 
840
  
 
841
  GP<DataPool> pool = this->pool;
842
842
  {
843
843
         // Wait until the static_trigger_cb() exits
844
844
      GCriticalSectionLock lock(&trigger_lock);
846
846
        pool->del_trigger(static_trigger_cb, this);
847
847
      del_trigger(static_trigger_cb, this);
848
848
  }
849
 
 
850
849
  if (pool)
851
850
  {
852
851
      GCriticalSectionLock lock(&triggers_lock);
984
983
      if (dlength<0) return 0;
985
984
   }
986
985
   
987
 
   if (pool) return pool->get_size(start+dstart, dlength);
 
986
   GP<DataPool> pool = this->pool;
 
987
   if (pool) 
 
988
     return pool->get_size(start+dstart, dlength);
988
989
   else if (furl.is_local_file_url())
989
990
   {
990
991
      if (start+dstart+dlength>length) return length-(start+dstart);
1121
1122
   if (! sz)
1122
1123
     return 0;
1123
1124
   
 
1125
   GP<DataPool> pool = this->pool;
1124
1126
   if (pool)
1125
1127
     {
1126
1128
       DEBUG_MSG("DataPool::get_data(): from pool\n");
1340
1342
      // thru this DataPool again and will be stopped (DataPool::Stop exception)
1341
1343
      // Others (which entered the master DataPool thru other slave DataPools)
1342
1344
      // will simply continue waiting for their data.
 
1345
   GP<DataPool> pool = this->pool;
1343
1346
   if (pool)
1344
1347
   {
1345
1348
         // This loop is necessary because there may be another thread, which
1503
1506
        call_callback(callback, cl_data);
1504
1507
      }else
1505
1508
      {
 
1509
         GP<DataPool> pool = this->pool;
1506
1510
         if (pool)
1507
1511
         {
1508
1512
               // We're connected to a DataPool
1567
1571
        break;
1568
1572
   }
1569
1573
 
 
1574
   GP<DataPool> pool = this->pool;
1570
1575
   if (pool)
1571
1576
     pool->del_trigger(callback, cl_data);
1572
1577
}
1592
1597
   DEBUG_MSG("DataPool::trigger_cb() called\n");
1593
1598
   DEBUG_MAKE_INDENT(3);
1594
1599
 
 
1600
   GP<DataPool> pool = this->pool;
1595
1601
   if (pool)
1596
1602
   {
1597
1603
      // Connected to a pool