~haggai-eran/nux/rtl-rebased

« back to all changes in this revision

Viewing changes to NuxCore/ThreadWin.h

  • Committer: Jay Taoko
  • Date: 2011-10-21 23:49:15 UTC
  • mfrom: (508.1.2 nux-20)
  • Revision ID: jay.taoko@canonical.com-20111021234915-hnzakb5ndebica8i
* Removed custom Nux types: t_u32, t_s32, t_bool, ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    {
36
36
      m_Counter = 0;
37
37
    }
38
 
    NThreadSafeCounter (t_integer i)
 
38
    NThreadSafeCounter (long i)
39
39
    {
40
40
      m_Counter = i;
41
41
    }
42
 
    t_integer Increment();
43
 
    t_integer Decrement();
44
 
    t_integer Set (t_integer i);
45
 
    t_integer GetValue() const;
46
 
    t_integer operator ++ ();
47
 
    t_integer operator -- ();
48
 
    t_bool operator == (t_integer i);
 
42
    long Increment();
 
43
    long Decrement();
 
44
    long Set (long i);
 
45
    long GetValue() const;
 
46
    long operator ++ ();
 
47
    long operator -- ();
 
48
    bool operator == (long i);
49
49
  private:
50
 
    t_integer m_Counter;
 
50
    long m_Counter;
51
51
  };
52
52
 
53
53
  class NCriticalSection
178
178
    typedef void (*TLS_ShutdownCallback) ();
179
179
 
180
180
    static BOOL                     m_TLSUsed[NbTLS];
181
 
    static t_u32                     m_TLSIndex[NbTLS];
 
181
    static unsigned int                     m_TLSIndex[NbTLS];
182
182
    static TLS_ShutdownCallback     m_TLSCallbacks[NbTLS];
183
183
 
184
184
    static void Initialize();
185
185
    static void Shutdown();
186
 
    static BOOL RegisterTLS (t_u32 index, TLS_ShutdownCallback shutdownCallback);
 
186
    static BOOL RegisterTLS (unsigned int index, TLS_ShutdownCallback shutdownCallback);
187
187
    static void ThreadInit();
188
188
    static void ThreadShutdown();
189
189
 
190
190
  public:
191
191
 
192
 
    template<class T> static inline T GetData (t_u32 index)
 
192
    template<class T> static inline T GetData (unsigned int index)
193
193
    {
194
194
      nuxAssert (sizeof (T) <= sizeof (size_t) );
195
195
      nuxAssert (index < NbTLS);
206
206
      return temp.t;
207
207
    }
208
208
 
209
 
    template<class T> static inline void SetData (t_u32 index, T value)
 
209
    template<class T> static inline void SetData (unsigned int index, T value)
210
210
    {
211
211
      nuxAssert (sizeof (T) <= sizeof (size_t) );
212
212
      nuxAssert (index < NbTLS);
313
313
 
314
314
        This function starts the thread pointed by m_pThreadFunc with default attributes
315
315
    */
316
 
    t_u32 GetExitCode() const;
 
316
    unsigned int GetExitCode() const;
317
317
 
318
318
    /*!
319
319
        Info: Attaches a Thread Function
337
337
    }
338
338
 
339
339
    HANDLE GetThreadHandle();
340
 
    t_u32 GetThreadId();
 
340
    unsigned int GetThreadId();
341
341
 
342
342
 
343
343
    ThreadState GetThreadState() const;
373
373
        Notice the signature is similar to that of any worker thread function
374
374
        except for the calling convention.
375
375
    */
376
 
    virtual t_u32 Run (void* /* arg */ )
 
376
    virtual unsigned int Run (void* /* arg */ )
377
377
    {
378
378
      return m_ThreadCtx.m_dwExitCode;
379
379
    }
431
431
      */
432
432
    public:
433
433
      HANDLE m_hThread;                                 //      The Thread Handle
434
 
      volatile t_u32  m_dwTID;                                          //      The Thread ID
 
434
      volatile unsigned int  m_dwTID;                                           //      The Thread ID
435
435
      void *m_pUserData;                                                //      The user data pointer
436
436
      void *m_pParent;                                  //      The this pointer of the parent NThread object
437
 
      t_u32  m_dwExitCode;                              //      The Exit Code of the thread
 
437
      unsigned int  m_dwExitCode;                               //      The Exit Code of the thread
438
438
    };
439
439
 
440
440
    /*!
453
453
//
454
454
//    class CDemoThread : public CThread
455
455
//    {
456
 
//        virtual t_u32 Run( void* /* arg */ )
 
456
//        virtual unsigned int Run( void* /* arg */ )
457
457
//        {
458
458
//            for(;;)
459
459
//            {