• 首頁
  • 文件
  • 下載
  • 狀態
  • 常見問題
  • 郵件列表
  • 應用程式
  • 外部鏈結
  • 版權
  • 志願者
  • 聯繫

類別:ThreadData

類型 使用 成員 說明
建構子 public ThreadData(void)
解構子 public ~ThreadData(void)
資料 public int Id 。
資料 public int Type 。
資料 public int Priority 。
資料 public int Status 。
資料 public int Running 。
資料 public int StackSize 。
資料 public bool Reservation 。
資料 public char * Arguments 。
資料 public void * Extra 。
資料 public Thread 。
資料 public unsigned int dwThreadID 。
資料 public ThreadFunction Function 實際的線緒函式。
函式 public void Start (void) 設定開始。
函式 public void Stop (void) 設定停止。
函式 public void Join (void) 。
函式 public int setPriority (int priority) 。
函式 public ThreadId (void) 。
函式 public bool isSelf (void) 。

建議



C++定義

#if defined(WIN32) || defined(_WIN32)
typedef unsigned int (*ThreadFunction)(void * arg) ;
#else
typedef void *       (*ThreadFunction)(void * arg) ;
#endif

class ThreadData
{
  public:

    enum ThreadState {
      Idle     = 0   ,
      Active   = 1   ,
      Deactive = 2   ,
      Recycle  = 3 } ;

    int     Id          ;
    int     Type        ;
    int     Priority    ;
    int     Status      ;
    int     Running     ;
    int     StackSize   ;
    bool    Reservation ; // STACK_SIZE_PARAM_IS_A_RESERVATION ;
    char *  Arguments   ;
    void *  Extra       ;

    #if defined(WIN32) || defined(_WIN32)
    HANDLE         Thread              ;
    unsigned int   dwThreadID          ;
    #else
    pthread_t      Thread              ;
    #endif
    ThreadFunction Function            ;

    explicit  ThreadData  (void) ;
    virtual ~ ThreadData  (void) ;

    void      Start       (void) ;
    void      Stop        (void) ;
    void      Join        (void) ;

    int       setPriority (int priority) ;

    #if defined(WIN32) || defined(_WIN32)
    HANDLE    ThreadId    (void) ;
    #else
    pthread_t ThreadId    (void) ;
    #endif

    bool      isSelf      (void) ;

};


範例