• 首页
  • 文件
  • 下载
  • 状态
  • 常见问题
  • 邮件列表
  • 应用程序
  • 外部链结
  • 版权
  • 志愿者
  • 联络

类别: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) ;

};


示范