tac0S
Template Affectional Command Operating System
Public Member Functions | List of all members
UserThread Class Reference

Public Member Functions

 UserThread (void *, void *arg, unsigned int tid, int exitPC)
 UserThread::UserThread. More...
 
 ~UserThread ()
 UserThread::~UserThread Delete the UserThread class.
 
void Run ()
 UserThread::Run Do the fork and place the thread into the ready list.
 
unsigned int getId ()
 UserThread::getId() get The Thread Id. More...
 
void exit (void *returnAdress)
 UserThread::exit Finis the thread. Put information on the current UserThreadData if it had a parent. More...
 
void * WaitForChildExited (int CID)
 UserThread::WaitForChildExited Current thraid will wait that his child end. More...
 
void WaitForAllChildExited ()
 UserThread::WaitForAllChildExited Wait for all the child exited.
 
int StopChild (unsigned int CID)
 
int WakeUpChild (unsigned int CID)
 
int makeChildSurvive (unsigned int CID)
 UserThread::makeChildSurvive Pass a child in suvivor mode. More...
 
void makeAllChildSurvive ()
 UserThread::makeAllChildSurvive Put all the child of the current thread in survivor mode.
 
ListgetChildList ()
 UserThread::getChildList Get the child list and put a lock on it when done, don't forget to use DoneWithTheChildList();. More...
 
void DoneWithTheChildList ()
 UserThread::DoneWithTheChildList trash the lock Locked from getChildList.
 
ThreadgetThread ()
 UserThread::getThread Get the Thread of the UserThread. More...
 
bool removeChild (void *childToRemove)
 UserThread::removeChild Remove the child of the current child list. More...
 
void addChildren (UserThread *UTC)
 UserThread::addChildren Add a thread to the child list. More...
 
void setParrent (UserThread *UTP)
 UserThread::setParrent Add a parrent to the current thread. More...
 
UserThreadgetParrent ()
 UserThread::getParrent Get the UserThread * parrent. More...
 
void * getUserThreadDataChild (unsigned int CID)
 UserThread::getUserThreadDataChild Get the Meta Data structure of the child with TID CID. More...
 
void * getMeta ()
 UserThread::getMeta return the adress of the metaStructure. More...
 
void setMeta (void *)
 UserThread::setMeta Set a metaData for the current thread. More...
 
bool isSurvivor ()
 UserThread::isSurvivor Test if the current thread is in mode survivor. More...
 
void setSurvivor (bool boolean)
 UserThread::setSurvivor Enable or disable the survivor mode. More...
 
int * getTableOfOpenfile ()
 

Constructor & Destructor Documentation

UserThread::UserThread ( void *  f,
void *  arg,
unsigned int  tid,
int  exitPC 
)

UserThread::UserThread.

Parameters
fThe function where the thread will begin
argThe adress of the object passed in parameter
tidThe Thread Identifiant

Member Function Documentation

void UserThread::addChildren ( UserThread UTC)

UserThread::addChildren Add a thread to the child list.

Parameters
UTCUserThread *
void UserThread::exit ( void *  returnAdress)

UserThread::exit Finis the thread. Put information on the current UserThreadData if it had a parent.

Parameters
returnAdressvoid * : The adress of the object you want to return
List * UserThread::getChildList ( )

UserThread::getChildList Get the child list and put a lock on it when done, don't forget to use DoneWithTheChildList();.

Returns
List *
unsigned int UserThread::getId ( )

UserThread::getId() get The Thread Id.

Returns
unsigned int ID
void * UserThread::getMeta ( )

UserThread::getMeta return the adress of the metaStructure.

Returns
void *
UserThread * UserThread::getParrent ( )

UserThread::getParrent Get the UserThread * parrent.

Returns
UserThread *
Thread * UserThread::getThread ( )

UserThread::getThread Get the Thread of the UserThread.

Returns
Thread *
void * UserThread::getUserThreadDataChild ( unsigned int  CID)

UserThread::getUserThreadDataChild Get the Meta Data structure of the child with TID CID.

Parameters
CID
Returns
A void * or NULL if the not a child
bool UserThread::isSurvivor ( )

UserThread::isSurvivor Test if the current thread is in mode survivor.

Returns
int UserThread::makeChildSurvive ( unsigned int  CID)

UserThread::makeChildSurvive Pass a child in suvivor mode.

Parameters
CIDChild id
Returns
1 if the TID is not a child ID, 0 otherwise
bool UserThread::removeChild ( void *  childToRemove)

UserThread::removeChild Remove the child of the current child list.

Parameters
childToRemove
Returns
void UserThread::setMeta ( void *  meta)

UserThread::setMeta Set a metaData for the current thread.

Parameters
meta
void UserThread::setParrent ( UserThread UTP)

UserThread::setParrent Add a parrent to the current thread.

Parameters
UTPUserThread * Parrent
void UserThread::setSurvivor ( bool  boolean)

UserThread::setSurvivor Enable or disable the survivor mode.

Parameters
booleanTrue to enabe, false to disable
void * UserThread::WaitForChildExited ( int  CID)

UserThread::WaitForChildExited Current thraid will wait that his child end.

Parameters
CIDThe child TID
Returns
void * the adress of the object the child wanted to return. Return -1 if it's not a child's TiD

The documentation for this class was generated from the following files: