Changeset 20816

Show
Ignore:
Timestamp:
09/16/07 20:52:20 (1 year ago)
Author:
patrick
Message:

Make yet another pass at cleaning up the VPR thread interface. This time
around includes the following changes:

  • Removed unneeded, unused, unwanted polymorphism from vpr::BaseThread? and
    vpr::Thread.
  • Improved const correctness.
  • Reorganized the vpr::BaseThread? interface declarations to group things
    more logically.

Bumped the version to 2.1.7.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vapor/ChangeLog

    r20815 r20816  
    11DATE       AUTHOR   CHANGE 
    22---------- -------- ----------------------------------------------------------- 
     32007-09-16 patrick  Removed polymorphism from vpr::BaseThread and vpr::Thread. 
     4                    NEW VERSION: 2.1.7 
    352007-09-16 patrick  Added vpr::ThreadWin32::setRunOn() and 
    46                    vpr::ThreadWin32::getRunOn(). Added Linux-specific 
  • juggler/trunk/modules/vapor/VERSION

    r20815 r20816  
     12.1.7-0 @09/16/2007 01:55:00 UTC@ 
    122.1.6-0 @09/16/2007 00:55:00 UTC@ 
    232.1.5-0 @08/22/2007 00:45:00 UTC@ 
  • juggler/trunk/modules/vapor/vpr/Thread/BaseThread.cpp

    r19897 r20816  
    5353 
    5454vpr::Int32 BaseThread::mNextThreadId = 0; 
    55 vpr::TSTable BaseThread::gTSTable; 
     55vpr::TSTable BaseThread::sTSTable; 
    5656 
    5757boost::signals::connection BaseThread:: 
     
    6969} 
    7070 
     71BaseThread::BaseThread() 
     72   : mThreadId(-1) 
     73{ 
     74   ; 
     75} 
     76 
     77BaseThread::~BaseThread() 
     78{ 
     79   /* Do nothing. */ ; 
     80} 
     81 
    7182/** 
    7283 * Ouputs the state of the object. 
     
    7990   return out; 
    8091} 
    81  
    8292 
    8393   // ---- Ouput operator ---- // 
     
    96106} 
    97107 
    98 void BaseThread::registerThread(bool succesfulCreation) 
     108void BaseThread::registerThread(const bool succesfulCreation) 
    99109{ 
    100    if(succesfulCreation)   // Succeed 
     110   if ( succesfulCreation )   // Succeed 
    101111   { 
    102112      createThreadId(); 
    103       Thread* thread_ptr = dynamic_cast<Thread*>(this); 
    104       vprASSERT(NULL != thread_ptr); 
    105       ThreadManager::instance()->addThread(thread_ptr); // Add the thread to the table 
     113      // Add the thread to the table 
     114      ThreadManager::instance()->addThread(static_cast<Thread*>(this)); 
    106115   } 
    107116   else 
     
    113122void BaseThread::unregisterThread() 
    114123{ 
    115    vpr::Thread* thread_ptr = dynamic_cast<vpr::Thread*>(this); 
    116    vprASSERT(NULL != thread_ptr); 
    117    vpr::ThreadManager::instance()->removeThread(thread_ptr); 
     124   vpr::ThreadManager::instance()->removeThread( 
     125      static_cast<vpr::Thread*>(this) 
     126   ); 
    118127} 
    119128 
  • juggler/trunk/modules/vapor/vpr/Thread/BaseThread.h

    r20676 r20816  
    3939#include <vpr/vprConfig.h> 
    4040 
     41#include <boost/noncopyable.hpp> 
    4142#include <boost/function.hpp> 
    4243#include <boost/signal.hpp> 
     44 
    4345#include <vpr/vprTypes.h> 
    4446#include <vpr/Thread/TSTable.h>            /* Needed to cache a copy here */ 
     
    6163 * Provides functionality that is common to all threading implementations. 
    6264 * 
    63  * @note This class is not designed to be used as a polymorphic base class 
    64  * to hold references to threads.  Just use the real thread type. 
     65 * @note This class is \em not designed to be used as a polymorphic base class 
     66 *       to hold references to threads. The lack of virtual methods should 
     67 *       make this fact self-evident. Just use the real thread type. 
    6568 */ 
    66 class VPR_CLASS_API BaseThread 
     69class VPR_CLASS_API BaseThread : private boost::noncopyable 
    6770{ 
    6871public: 
     
    157160   }; 
    158161 
    159    BaseThread() : mThreadId(-1) 
    160    { 
    161       ; 
    162    } 
    163  
    164    virtual ~BaseThread() 
    165    { 
    166       ; 
    167    } 
    168  
    169    /** Sets the thread's functor--the code that will get executed. */ 
    170    virtual void setFunctor(const vpr::thread_func_t& functor) = 0; 
    171  
    172    /** Starts the thread's execution. */ 
    173    virtual void start() = 0; 
     162protected: 
     163   BaseThread(); 
     164 
     165   ~BaseThread(); 
    174166 
    175167public:     // Thread specific data caching 
     
    185177   } 
    186178 
     179   const TSTable* getTSTable() const 
     180   { 
     181      return &mTSTable; 
     182   } 
     183 
    187184   /** 
    188185    * Get the Thread the global thread specific data table. 
     
    191188   static TSTable* getGlobalTSTable() 
    192189   { 
    193       return &gTSTable; 
     190      return &sTSTable; 
     191   } 
     192 
     193   /** 
     194    * Gets the "thread ID" of this vpr::BaseThread object.  This is a unique 
     195    * integer value assigned when the thread was created. 
     196    * 
     197    * @return -1 is returned if this is a bad thread.  This usually means that 
     198    *         there was a creation error. 
     199    * @return Otherwise, the value returned is this thread's ID. 
     200    */ 
     201   vpr::Int32 getTID() const 
     202   { 
     203      return mThreadId; 
     204   } 
     205 
     206   /** 
     207    * Is this a valid thread? 
     208    * 
     209    * @return true is returned if this object represents a thread that has 
     210    *         been spawned correctly. 
     211    * 
     212    * @note A true value may be returned before the spawned thread begins 
     213    *       executing.  This is due to the way that the operating system 
     214    *       schedules a newly created thread.  However, true is returned if 
     215    *       and only if the thread has been spawned successfully. 
     216    */ 
     217   bool valid() const 
     218   { 
     219      return mThreadId != -1; 
    194220   } 
    195221 
    196222private: 
    197223   TSTable        mTSTable;  /**< Thread specific data for the thread */ 
    198    static TSTable gTSTable;  /**< Global thread specific data.  Used in all 
     224   static TSTable sTSTable;  /**< Global thread specific data.  Used in all 
    199225                                  threads NOT created by vpr.  (ie. the 
    200226                                  primordial thread). */ 
    201227 
    202228protected: 
     229   /** 
     230    * Ouputs the state of the object. 
     231    */ 
     232   std::ostream& outStream(std::ostream& out); 
     233 
    203234   /** 
    204235    * After the object has been created, call this routine to complete 
     
    214245    * @param successfulCreation Did the thread get created correctly? 
    215246    */ 
    216    void registerThread(bool successfulCreation); 
     247   void registerThread(const bool successfulCreation); 
    217248 
    218249   void unregisterThread(); 
    219250 
    220 public: 
    221    /** 
    222     * Causes the calling thread wait for the termination of this thread. 
    223     * 
    224     * @post The caller blocks until this thread finishes its execution. 
    225     *       This routine may return immediately if this thread has already 
    226     *       exited. 
    227     * 
    228     * @param status Current state of the terminating thread when that thread 
    229     *               calls the exit routine (optional). 
    230     * 
    231     * @note This implementation does onthing. See the derived classes for more 
    232     *       information. 
    233     */ 
    234    virtual void join(void** = NULL) 
    235    { 
    236       /* Do nothing. */ ; 
    237    } 
    238  
    239    /** 
    240     * Resumes the execution of this thread (if it was previously suspended 
    241     * using suspend()). 
    242     * 
    243     * @note This implementation does nothing. See the derived classes for more 
    244     *       information. 
    245     */ 
    246    virtual void resume() 
    247    { 
    248       /* Do nothing. */ ; 
    249    } 
    250  
    251    /** 
    252     * Suspends the execution of this thread. 
    253     * 
    254     * @note This implementation does nothing. See the derived classes for more 
    255     *       information. 
    256     */ 
    257    virtual void suspend() 
    258    { 
    259       /* Do nothing. */ ; 
    260    } 
    261  
    262    /** 
    263     * Gets this thread's priority. 
    264     * 
    265     * @return This implementation always returns \c VPR_PRIORITY_NORMAL. See 
    266     *         the derived classes for more information. 
    267     */ 
    268    virtual VPRThreadPriority getPrio() 
    269    { 
    270       return VPR_PRIORITY_NORMAL; 
    271    } 
    272  
    273    /** 
    274     * Sets this thread's priority. 
    275     * 
    276     * @param prio The new priority for this thread. 
    277     * 
    278     * @note This implementation does nothing. See the derived classes for more 
    279     *       information. 
    280     */ 
    281    virtual void setPrio(const VPRThreadPriority) 
    282    { 
    283       /* Do nothing. */ ; 
    284    } 
    285  
    286    /** 
    287     * Gets the "thread ID" of this vpr::BaseThread object.  This is a unique 
    288     * integer value assigned when the thread was created. 
    289     * 
    290     * @return -1 is returned if this is a bad thread.  This usually means that 
    291     *         there was a creation error. 
    292     * @return Otherwise, the value returned is this thread's ID. 
    293     */ 
    294    vpr::Int32 getTID() 
    295    { 
    296       return mThreadId; 
    297    } 
    298  
    299    /** 
    300     * Is this a valid thread? 
    301     * 
    302     * @return true is returned if this object represents a thread that has 
    303     *         been spawned correctly. 
    304     * 
    305     * @note A true value may be returned before the spawned thread begins 
    306     *       executing.  This is due to the way that the operating system 
    307     *       schedules a newly created thread.  However, true is returned if 
    308     *       and only if the thread has been spawned successfully. 
    309     */ 
    310    bool valid() 
    311    { 
    312       return (mThreadId != -1); 
    313    } 
    314  
    315    /** 
    316     * Sends the specified signal to this thread (not necessarily \c SIGKILL). 
    317     * 
    318     * @post This thread receives the specified signal. 
    319     * 
    320     * @param signum The signal to send to this thread. 
    321     * 
    322     * @note This implementation does nothing. See the derived classes for 
    323     *       more information. 
    324     */ 
    325    virtual void kill(const int) 
    326    { 
    327       /* Do nothing. */ ; 
    328    } 
    329  
    330    /** 
    331     * Kills (cancels) this thread. 
    332     * 
    333     * @post This thread is cancelled. Immediate cancellation is not guaranteed. 
    334     * 
    335     * @note This implementation does nothing. See the derived classes for 
    336     *       more information. 
    337     */ 
    338    virtual void kill() 
    339    { 
    340       /* Do nothing. */ ; 
    341    } 
    342  
    343    /** 
    344     * Ouputs the state of the object. 
    345     */ 
    346    virtual std::ostream& outStream(std::ostream& out); 
    347  
    348 protected: 
    349251   /** 
    350252    * Initializes the state of the object. 
     
    355257   } 
    356258 
    357 private: 
    358    /// Don't allow copy 
    359    BaseThread(BaseThread&) 
    360    {;} 
    361  
    362 protected: 
    363    vpr::Int32  mThreadId;    //! The local id for the thread, -1 ==> invalid thread 
    364  
    365    // --- STATICS ---- // 
     259protected: 
     260   /** 
     261    * The local ID for the thread. A value of -1 implies that this is an 
     262    * invalid thread. 
     263    */ 
     264   vpr::Int32 mThreadId; 
    366265 
    367266private: 
  • juggler/trunk/modules/vapor/vpr/md/NSPR/Thread/ThreadNSPR.cpp

    r19897 r20816  
    269269} 
    270270 
    271 BaseThread::VPRThreadPriority ThreadNSPR::getPrio() 
     271BaseThread::VPRThreadPriority ThreadNSPR::getPrio() const 
    272272{ 
    273273   return nsprThreadPriorityToVPR(PR_GetThreadPriority(mThread)); 
     
    284284// =========================================================================== 
    285285 
    286  
    287 PRThreadPriority ThreadNSPR::vprThreadPriorityToNSPR(const VPRThreadPriority priority) 
     286PRThreadPriority 
     287ThreadNSPR::vprThreadPriorityToNSPR(const VPRThreadPriority priority) const 
    288288{ 
    289289   PRThreadPriority nspr_prio; 
     
    309309 
    310310PRThreadScope ThreadNSPR::vprThreadScopeToNSPR(const VPRThreadScope scope) 
     311   const 
    311312{ 
    312313   PRThreadScope nspr_scope; 
     
    326327 
    327328PRThreadState ThreadNSPR::vprThreadStateToNSPR(const VPRThreadState state) 
     329   const 
    328330{ 
    329331   PRThreadState nspr_state; 
     
    342344} 
    343345 
    344 BaseThread::VPRThreadPriority ThreadNSPR::nsprThreadPriorityToVPR(const PRThreadPriority priority) 
     346BaseThread::VPRThreadPriority 
     347ThreadNSPR::nsprThreadPriorityToVPR(const PRThreadPriority priority) const 
    345348{ 
    346349   VPRThreadPriority vpr_prio; 
     
    365368} 
    366369 
    367 BaseThread::VPRThreadScope ThreadNSPR::nsprThreadScopeToVPR(const PRThreadScope scope) 
     370BaseThread::VPRThreadScope 
     371ThreadNSPR::nsprThreadScopeToVPR(const PRThreadScope scope) const 
    368372{ 
    369373   VPRThreadScope vpr_scope; 
     
    383387} 
    384388 
    385 BaseThread::VPRThreadState ThreadNSPR::nsprThreadStateToVPR(const PRThreadState state) 
     389BaseThread::VPRThreadState 
     390ThreadNSPR::nsprThreadStateToVPR(const PRThreadState state) const 
    386391{ 
    387392   VPRThreadState vpr_state; 
  • juggler/trunk/modules/vapor/vpr/md/NSPR/Thread/ThreadNSPR.h

    r20815 r20816  
    145145    *        thread hash. 
    146146    */ 
    147    virtual ~ThreadNSPR(); 
     147   ~ThreadNSPR(); 
    148148 
    149149   /** 
     
    152152    * @pre The thread is not already running.  The functor is valid. 
    153153    */ 
    154    virtual void setFunctor(const vpr::thread_func_t& functor); 
     154   void setFunctor(const vpr::thread_func_t& functor); 
    155155 
    156156   /** 
     
    167167    *        allocated. 
    168168    */ 
    169    virtual void start(); 
     169   void start(); 
    170170 
    171171   /** 
     
    185185    *        thrown by code executing in this thread and was not caught. 
    186186    */ 
    187    virtual void join(void** status = NULL); 
     187   void join(void** status = NULL); 
    188188 
    189189   /** 
     
    201201    * @note This operation is not currently supported with NSPR threads. 
    202202    */ 
    203    virtual void resume() 
     203   void resume() 
    204204   { 
    205205//      this->kill(SIGCONT); 
     
    218218    * @note This operation is not currently supported with NSPR threads. 
    219219    */ 
    220    virtual void suspend() 
     220   void suspend() 
    221221   { 
    222222//      this->kill(SIGSTOP); 
     
    231231    *        thread (and thus cannot have its scheduling queried). 
    232232    */ 
    233    virtual VPRThreadPriority getPrio()
     233   VPRThreadPriority getPrio() const
    234234 
    235235   /** 
     
    243243    *        enumerated type. 
    244244    */ 
    245    virtual void setPrio(const VPRThreadPriority prio); 
    246  
    247    virtual void setRunOn(const unsigned int) 
     245   void setPrio(const VPRThreadPriority prio); 
     246 
     247   void setRunOn(const unsigned int) 
    248248   { 
    249249      /* Do nothing. */ ; 
    250250   } 
    251251 
    252    virtual std::vector<unsigned int> getRunOn() 
     252   std::vector<unsigned int> getRunOn() const 
    253253   { 
    254254      return std::vector<unsigned int>(); 
     
    268268    * @note This operation is not currently supported by NSPR threads. 
    269269    */ 
    270    virtual void kill(const int) 
     270   void kill(const int) 
    271271   { 
    272272      /* Do nothing. */ ; 
     
    284284    * @note This operation is not currently supported by NSPR threads. 
    285285    */ 
    286    virtual void kill() 
     286   void kill() 
    287287   { 
    288288      /* Do nothing. */ ; 
     
    313313    * Provides a way of printing the process ID neatly. 
    314314    */ 
    315    virtual std::ostream& outStream(std::ostream& out); 
     315   std::ostream& outStream(std::ostream& out); 
    316316 
    317317// All private member variables and functions. 
     
    343343   vpr::CondVarNSPR  mThreadStartCondVar;    /**< CondVar for thread starting */ 
    344344 
    345    PRThreadPriority vprThreadPriorityToNSPR(const VPRThreadPriority priority); 
    346  
    347    PRThreadScope vprThreadScopeToNSPR(const VPRThreadScope scope); 
    348  
    349    PRThreadState vprThreadStateToNSPR(const VPRThreadState state); 
    350  
    351    VPRThreadPriority nsprThreadPriorityToVPR(const PRThreadPriority priority); 
    352  
    353    VPRThreadScope nsprThreadScopeToVPR(const PRThreadScope scope); 
    354  
    355    VPRThreadState nsprThreadStateToVPR(const PRThreadState state); 
     345   PRThreadPriority vprThreadPriorityToNSPR(const VPRThreadPriority priority) 
     346      const; 
     347 
     348   PRThreadScope vprThreadScopeToNSPR(const VPRThreadScope scope) const; 
     349 
     350   PRThreadState vprThreadStateToNSPR(const VPRThreadState state) const; 
     351 
     352   VPRThreadPriority nsprThreadPriorityToVPR(const PRThreadPriority priority) 
     353      const; 
     354 
     355   VPRThreadScope nsprThreadScopeToVPR(const PRThreadScope scope) const; 
     356 
     357   VPRThreadState nsprThreadStateToVPR(const PRThreadState state) const; 
    356358 
    357359   static PRUint32               mTicksPerSec; 
  • juggler/trunk/modules/vapor/vpr/md/POSIX/Thread/ThreadPosix.cpp

    r20815 r20816  
    328328 
    329329// Get this thread's priority. 
    330 BaseThread::VPRThreadPriority ThreadPosix::getPrio() 
     330BaseThread::VPRThreadPriority ThreadPosix::getPrio() const 
    331331{ 
    332332#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING 
     
    429429} 
    430430 
    431 std::vector<unsigned int> ThreadPosix::getRunOn() 
     431std::vector<unsigned int> ThreadPosix::getRunOn() const 
    432432{ 
    433433   std::vector<unsigned int> cpus; 
     
    543543 
    544544int ThreadPosix::vprThreadPriorityToPOSIX(const VPRThreadPriority priority) 
     545   const 
    545546{ 
    546547   int posix_prio; 
     
    570571} 
    571572 
    572 int ThreadPosix::vprThreadScopeToPOSIX(const VPRThreadScope scope) 
     573int ThreadPosix::vprThreadScopeToPOSIX(const VPRThreadScope scope) const 
    573574{ 
    574575   int posix_scope; 
     
    590591} 
    591592 
    592 int ThreadPosix::vprThreadStateToPOSIX(const VPRThreadState state) 
     593int ThreadPosix::vprThreadStateToPOSIX(const VPRThreadState state) const 
    593594{ 
    594595   int posix_state; 
     
    611612 
    612613BaseThread::VPRThreadPriority ThreadPosix:: 
    613 posixThreadPriorityToVPR(const int priority) 
     614posixThreadPriorityToVPR(const int priority) const 
    614615{ 
    615616   VPRThreadPriority vpr_prio; 
     
    636637 
    637638BaseThread::VPRThreadScope ThreadPosix::posixThreadScopeToVPR(const int scope) 
     639   const 
    638640{ 
    639641   VPRThreadScope vpr_scope; 
     
    671673 
    672674BaseThread::VPRThreadState ThreadPosix::posixThreadStateToVPR(const int state) 
     675   const 
    673676{ 
    674677   VPRThreadState vpr_state; 
  • juggler/trunk/modules/vapor/vpr/md/POSIX/Thread/ThreadPosix.h

    r20815 r20816  
    153153    *       thread hash. 
    154154    */ 
    155    virtual ~ThreadPosix(); 
     155   ~ThreadPosix(); 
    156156 
    157157   /** 
     
    160160    * @pre The thread is not already running.  The functor is valid. 
    161161    */ 
    162    virtual void setFunctor(const vpr::thread_func_t& functor); 
     162   void setFunctor(const vpr::thread_func_t& functor); 
    163163 
    164164   /** 
     
    180180    *        creation of the thread. 
    181181    */ 
    182    virtual void start(); 
     182   void start(); 
    183183 
    184184protected: 
     
    233233    *        thrown by code executing in this thread and was not caught. 
    234234    */ 
    235    virtual void join(void** status = NULL); 
     235   void join(void** status = NULL); 
    236236 
    237237   /** 
     
    249249    * @note This is not currently supported on HP-UX 10.20. 
    250250    */ 
    251    virtual void resume() 
     251   void resume() 
    252252   { 
    253253      this->kill(SIGCONT); 
     
    266266    * @note This is not currently supported on HP-UX 10.20. 
    267267    */ 
    268    virtual void suspend() 
     268   void suspend() 
    269269   { 
    270270      this->kill(SIGSTOP); 
     
    286286    *       scheduling in their pthreads implementation. 
    287287    */ 
    288    virtual VPRThreadPriority getPrio()
     288   VPRThreadPriority getPrio() const
    289289 
    290290   /** 
     
    302302    *       scheduling in their pthreads implementation. 
    303303    */ 
    304    virtual void setPrio(const VPRThreadPriority prio); 
     304   void setPrio(const VPRThreadPriority prio); 
    305305 
    306306   /** 
     
    328328    * @note Currently, this is only available on IRIX 6.5 and Linux. 
    329329    */ 
    330    virtual void setRunOn(const unsigned int cpu); 
     330   void setRunOn(const unsigned int cpu); 
    331331 
    332332   /** 
     
    354354    * @note Currently, this is only available on IRIX 6.5 and Linux. 
    355355    * @note The return value of this method was changed from int to 
    356     *       std::vector<unsigned int> in VPR 2.1.7
    357     */ 
    358    virtual std::vector<unsigned int> getRunOn()
     356    *       std::vector<unsigned int> in VPR 2.1.6
     357    */ 
     358   std::vector<unsigned int> getRunOn() const
    359359 
    360360   /** 
     
    384384    * @note This is not currently supported with Pthreads Draft 4. 
    385385    */ 
    386    virtual void kill(const int signum); 
     386   void kill(const int signum); 
    387387 
    388388   /** 
     
    395395    *       cancellation is not guaranteed. 
    396396    */ 
    397    virtual void kill() 
     397   void kill() 
    398398   { 
    399399      pthread_cancel(mThread); 
     
    437437 
    438438   /** Converts a VPR thread priority to its Pthread equivalent. */ 
    439    int vprThreadPriorityToPOSIX(const VPRThreadPriority priority)
     439   int vprThreadPriorityToPOSIX(const VPRThreadPriority priority) const
    440440 
    441441   /** Converts a VPR thread scope to its Pthread equivalent. */ 
    442    int vprThreadScopeToPOSIX(const VPRThreadScope scope)
     442   int vprThreadScopeToPOSIX(const VPRThreadScope scope) const
    443443 
    444444   /** Converts a VPR thread state value to its Pthread equivalent. */ 
    445    int vprThreadStateToPOSIX(const VPRThreadState state)
     445   int vprThreadStateToPOSIX(const VPRThreadState state) const
    446446 
    447447   /** Converts a Pthread thread priority to its VPR equivalent. */ 
    448    VPRThreadPriority posixThreadPriorityToVPR(const int priority)
     448   VPRThreadPriority posixThreadPriorityToVPR(const int priority) const
    449449 
    450450   /** Converts a Pthread thread scope to its VPR equivalent. */ 
    451    VPRThreadScope posixThreadScopeToVPR(const int scope)
     451   VPRThreadScope posixThreadScopeToVPR(const int scope) const
    452452 
    453453   /** Converts a Pthread thread state value to its VPR equivalent. */ 
    454    VPRThreadState posixThreadStateToVPR(const int state)
     454   VPRThreadState posixThreadStateToVPR(const int state) const
    455455 
    456456// =========================================================================== 
  • juggler/trunk/modules/vapor/vpr/md/WIN32/Thread/ThreadWin32.cpp

    r20815 r20816  
    272272} 
    273273 
    274 BaseThread::VPRThreadPriority ThreadWin32::getPrio() 
     274BaseThread::VPRThreadPriority ThreadWin32::getPrio() const 
    275275{ 
    276276   const int priority = GetThreadPriority(mThreadHandle); 
     
    333333} 
    334334 
    335 std::vector<unsigned int> ThreadWin32::getRunOn() 
     335std::vector<unsigned int> ThreadWin32::getRunOn() const 
    336336{ 
    337337   std::vector<unsigned int> cpus; 
     
    399399 
    400400int ThreadWin32::vprThreadPriorityToWin32(const VPRThreadPriority priority) 
     401   const 
    401402{ 
    402403   int win32_prio(THREAD_PRIORITY_NORMAL); 
     
    422423 
    423424BaseThread::VPRThreadPriority 
    424 ThreadWin32::win32ThreadPriorityToVPR(const int priority) 
     425ThreadWin32::win32ThreadPriorityToVPR(const int priority) const 
    425426{ 
    426427   VPRThreadPriority vpr_prio; 
  • juggler/trunk/modules/vapor/vpr/md/WIN32/Thread/ThreadWin32.h

    r20815 r20816  
    148148    *       thread hash. 
    149149    */ 
    150    virtual ~ThreadWin32(); 
     150   ~ThreadWin32(); 
    151151 
    152152   /** 
     
    155155    * @pre The thread is not already running.  The functor is valid. 
    156156    */ 
    157    virtual void setFunctor(const vpr::thread_func_t& functor); 
     157   void setFunctor(const vpr::thread_func_t& functor); 
    158158 
    159159   /** 
     
    175175    *        creation of the thread. 
    176176    */ 
    177    virtual void start(); 
     177   void start(); 
    178178 
    179179protected: 
     
    227227    *        thrown by code executing in this thread and was not caught. 
    228228    */ 
    229    virtual void join(void** status = NULL); 
     229   void join(void** status = NULL); 
    230230 
    231231   /** 
     
    237237    * 
    238238    */ 
    239    virtual void resume(); 
     239   void resume(); 
    240240 
    241241   /** 
     
    243243    * 
    244244    */ 
    245    virtual void suspend(); 
     245   void suspend(); 
    246246 
    247247   /** 
     
    251251    *        thread (and thus cannot have its scheduling queried). 
    252252    */ 
    253    virtual VPRThreadPriority getPrio()
     253   VPRThreadPriority getPrio() const
    254254 
    255255   /** 
     
    260260    * @param prio The new priority for this thread. 
    261261    */ 
    262    virtual void setPrio(const VPRThreadPriority prio); 
     262   void setPrio(const VPRThreadPriority prio); 
    263263 
    264264   /** 
     
    303303    *           be queried. 
    304304    */ 
    305    std::vector<unsigned int> getRunOn()
     305   std::vector<unsigned int> getRunOn() const
    306306 
    307307   /** 
     
    325325    * @note This method does nothing. Use kill() instead. 
    326326    */ 
    327    virtual void kill(const int) 
     327   void kill(const int) 
    328328   { 
    329329      std::cerr << "vpr::ThreadWin32::kill() is not implemented!" 
     
    336336    * @post This thread is cancelled. 
    337337    */ 
    338    virtual void kill() 
     338   void kill() 
    339339   { 
    340340      CloseHandle(mThreadHandle); 
     
    378378 
    379379   /** Converts a VPR thread priority to its Win32 equivalent. */ 
    380    int vprThreadPriorityToWin32(const VPRThreadPriority priority)
     380   int vprThreadPriorityToWin32(const VPRThreadPriority priority) const
    381381 
    382382   /** Converts a Win32 thread priority to its VPR equivalent. */ 
    383    VPRThreadPriority win32ThreadPriorityToVPR(const int priority)
     383   VPRThreadPriority win32ThreadPriorityToVPR(const int priority) const
    384384 
    385385   struct staticWrapper