(file) Return to Thread.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Thread.h between version 1.36 and 1.37

version 1.36, 2003/10/30 00:22:39 version 1.37, 2004/06/03 15:04:54
Line 27 
Line 27 
 // //
 // Modified By: Markus Mueller // Modified By: Markus Mueller
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //              Amit K Arora, IBM (amita@in.ibm.com) for PEP#101
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 40 
Line 41 
 #include <Pegasus/Common/DQueue.h> #include <Pegasus/Common/DQueue.h>
 #include <Pegasus/Common/AcceptLanguages.h>  // l10n #include <Pegasus/Common/AcceptLanguages.h>  // l10n
 #include <Pegasus/Common/Linkage.h> #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/AutoPtr.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 257 
Line 259 
       // create and initialize a tsd       // create and initialize a tsd
       inline void create_tsd(const Sint8 *key, int size, void *buffer) throw(IPCException)       inline void create_tsd(const Sint8 *key, int size, void *buffer) throw(IPCException)
       {       {
          thread_data *tsd = new thread_data(key, size, buffer);          AutoPtr<thread_data> tsd(new thread_data(key, size, buffer));
          try { _tsd.insert_first(tsd); }          try { _tsd.insert_first(tsd.get()); }
          catch(IPCException& e) { e = e; delete tsd; throw; }          catch(IPCException& e) { e = e; throw; }
           tsd.release();
       }       }
  
       // get the buffer associated with the key       // get the buffer associated with the key
Line 295 
Line 298 
       // delete the tsd associated with the key       // delete the tsd associated with the key
       inline void delete_tsd(const Sint8 *key) throw(IPCException)       inline void delete_tsd(const Sint8 *key) throw(IPCException)
       {       {
          thread_data *tsd = _tsd.remove((const void *)key);           AutoPtr<thread_data> tsd(_tsd.remove((const void *)key));
          if(tsd != NULL)  
             delete tsd;  
       }       }
  
       // Note: Caller must delete the thread_data object returned (if not null)       // Note: Caller must delete the thread_data object returned (if not null)
Line 319 
Line 320 
             return;             return;
          }          }
  
          thread_data* tsd = _tsd.next(0);           AutoPtr<thread_data> tsd(_tsd.next(0));
          while(tsd)           while(tsd.get())
          {          {
             _tsd.remove_no_lock(tsd);              _tsd.remove_no_lock(tsd.get());
             delete tsd;              tsd.reset(_tsd.next(0));
             tsd = _tsd.next(0);  
          }          }
          _tsd.unlock();          _tsd.unlock();
       }       }
Line 336 
Line 336 
  
       {       {
          PEGASUS_ASSERT(key != NULL);          PEGASUS_ASSERT(key != NULL);
          thread_data *tsd ;           AutoPtr<thread_data> tsd ;
          tsd = _tsd.remove((const void *)key);  // may throw an IPC exception           tsd.reset(_tsd.remove((const void *)key));  // may throw an IPC exception
          delete tsd;           tsd.reset();
          thread_data *ntsd = new thread_data(key);           AutoPtr<thread_data> ntsd(new thread_data(key));
          ntsd->put_data(delete_func, size, value);          ntsd->put_data(delete_func, size, value);
          try { _tsd.insert_first(ntsd); }           try { _tsd.insert_first(ntsd.get()); }
          catch(IPCException& e) { e = e; delete ntsd; throw; }           catch(IPCException& e) { e = e; throw; }
        ntsd.release();
       }       }
       inline PEGASUS_THREAD_RETURN get_exit(void) { return _exit_code; }       inline PEGASUS_THREAD_RETURN get_exit(void) { return _exit_code; }
       inline PEGASUS_THREAD_TYPE self(void) {return pegasus_thread_self(); }       inline PEGASUS_THREAD_TYPE self(void) {return pegasus_thread_self(); }
Line 405 
Line 406 
  
       inline void create_tsd(const Sint8 *key ) throw(IPCException)       inline void create_tsd(const Sint8 *key ) throw(IPCException)
       {       {
          thread_data *tsd = new thread_data(key);           AutoPtr<thread_data> tsd(new thread_data(key));
          try { _tsd.insert_first(tsd); }           try { _tsd.insert_first(tsd.get()); }
          catch(IPCException& e) { e = e; delete tsd; throw; }           catch(IPCException& e) { e = e; throw; }
        tsd.release();
       }       }
       PEGASUS_THREAD_HANDLE _handle;       PEGASUS_THREAD_HANDLE _handle;
       Boolean _is_detached;       Boolean _is_detached;


Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2