(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.11 and 1.17

version 1.11, 2002/03/31 00:37:56 version 1.17, 2002/05/29 21:37:54
Line 34 
Line 34 
 #include <Pegasus/Common/Exception.h> #include <Pegasus/Common/Exception.h>
 #include <Pegasus/Common/DQueue.h> #include <Pegasus/Common/DQueue.h>
  
 // REVIEW: Spend time getting to know this.  
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD;  
  
 class PEGASUS_COMMON_LINKAGE cleanup_handler class PEGASUS_COMMON_LINKAGE cleanup_handler
 { {
Line 145 
Line 142 
  
       }       }
  
       void copy_data(void **buf, size_t *size) throw(BufferTooSmall, NullPointer)        void copy_data(void **buf, size_t *size) throw(NullPointer)
       {       {
          if((buf == NULL) || (size == NULL))          if((buf == NULL) || (size == NULL))
             throw NullPointer() ;             throw NullPointer() ;
Line 289 
Line 286 
             delete tsd;             delete tsd;
       }       }
  
         // Note: Caller must delete the thread_data object returned (if not null)
       inline void *remove_tsd(const Sint8 *key) throw(IPCException)       inline void *remove_tsd(const Sint8 *key) throw(IPCException)
       {       {
          return(_tsd.remove((const void *)key));          return(_tsd.remove((const void *)key));
Line 296 
Line 294 
  
       inline void empty_tsd(void) throw(IPCException)       inline void empty_tsd(void) throw(IPCException)
       {       {
          _tsd.empty_list();           thread_data* tsd;
            while (0 != (tsd = _tsd.remove_first()))
            {
               delete tsd;
            }
            //_tsd.empty_list();
       }       }
  
       // create or re-initialize tsd associated with the key       // create or re-initialize tsd associated with the key
       // if the tsd already exists, return the existing buffer        // if the tsd already exists, delete the existing buffer
       thread_data *put_tsd(const Sint8 *key, void (*delete_func)(void *), Uint32 size, void *value)        void put_tsd(const Sint8 *key, void (*delete_func)(void *), Uint32 size, void *value)
          throw(IPCException)          throw(IPCException)
  
       {       {
          PEGASUS_ASSERT(key != NULL);          PEGASUS_ASSERT(key != NULL);
          thread_data *tsd ;          thread_data *tsd ;
          tsd = _tsd.remove((const void *)key);  // may throw an IPC exception          tsd = _tsd.remove((const void *)key);  // may throw an IPC exception
            delete tsd;
          thread_data *ntsd = new thread_data(key);          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); }
          catch(IPCException& e) { e = e; delete ntsd; throw; }          catch(IPCException& e) { e = e; delete ntsd; throw; }
          return(tsd);  
       }       }
       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(); }


Legend:
Removed from v.1.11  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2