Changeset 1093 for Whitix

Show
Ignore:
Timestamp:
10/05/08 00:02:20 (2 months ago)
Author:
mwhitworth
Message:

Create new ThrGetProcess macros, add a object field to Process.

Location:
Whitix/branches/keobject/include
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/include/sched.h

    r608 r1093  
    5353void ThrIdleFunc(); 
    5454 
    55 /* Thread macros go here */ 
    56 #define ThrGetThread(thread)            ((thread)->refs++) 
    57 #define ThrReleaseThread(thread) \ 
    58 do { (thread)->refs--;  if ((thread)->refs <= 0) ThrFreeThread((thread)); } while(0) 
    59  
    60 #define ThrGetProcess(process)          ((process)->refs++) 
    61 #define ThrReleaseProcess(process) \ 
    62 do { (process)->refs--; if ((process)->refs <= 0) ThrFreeProcess((process)); } while(0) 
    63  
    6455/*********************************************************************** 
    6556 * 
  • Whitix/branches/keobject/include/task.h

    r859 r1093  
    3333struct Thread 
    3434{ 
    35         volatile DWORD currStack; 
     35        DWORD currStack; 
    3636        struct Process* parent; 
    3737        DWORD state,entry,esp3; 
     
    4444        struct JournalHandle* currHandle; /* Each thread can run its own transaction. */ 
    4545}; 
     46 
     47#define ThrGetThread(thread)            ((thread)->refs++) 
     48#define ThrReleaseThread(thread) \ 
     49do { (thread)->refs--;  if ((thread)->refs <= 0) ThrFreeThread((thread)); } while(0) 
    4650 
    4751extern struct Thread* idleTask; 
     
    5660{ 
    5761        struct ListHead next,sibling,children; 
    58         int exitCode,refs,state; 
     62        int exitCode, state; 
    5963        struct File* files; /* Dynamically allocated */ 
    6064        Spinlock fileListLock; 
     
    6670        DWORD pid; 
    6771        int cId; 
     72        struct KeObject object; 
    6873        struct ListHead areaList; 
    6974        struct MemManager* memManager; 
     
    7176}; 
    7277 
     78#define ThrGetProcess(process) (KeObjGet(&process->object)) 
     79#define ThrPutProcess(process) (KeObjPut(&process->object)) 
     80 
    7381#endif