void syncStatus(char status)
TCB sync progress
status - Status to synchronize(FALSE, TRUE)
Operates when event_pause is TRUE
TCB* createThings(char location, char *path)
Create virtual things
location - Method of positioning things
path - Path to file if location is SET_FROM_FILE
void initTCB(TCB* tcb, int thing_id, char location, char *path)
TCB initialization
tcb - TCB to initialize
thing_id - thing number to initialize
location - Method of positioning things
path - Path to file if location is SET_FROM_FILE
void initFollowerList(TCB *tcb)
follower list initialization
tcb - TCB of follower list to initialize
void initClusterInfo(TCB *tcb)
cinfo list initialization
tcb - TCB of cinfo list to initialize
void initDestroyedThingsList()
Initializing the list of dead things
void destroyThing(int thing_id)
Register dead things
thing_id - Dead thing number
void freeMutex(TCB *g_tcb)
Free the TCB's mutex resource
g_tcb - All TCB
void freeTCB()
Free the TCB resource
void setLeaderFunction(void (*leader)(TCB *))
Connect leader function
leader - function pointer
void setFollowerFunction(void (*follower)(TCB *))
Connect follower function
follower - function pointer
void setSpannerFunction(void (*spanner)(TCB *))
Connect spanner function
spanner - function pointer
struct _follower* getFollower(int thing_id)
Return a follower list of thing
thing_id - Thing number
RETURN - List of objects associated with thing_id
struct _resource* getResource(int thing_id)
Return a resouce information
thing_id - Thing number
RETURN - Resource information of thing
struct _message* getMessage(int thing_id)
Return message information of thing
thing_id - Thing number
RETURN - Message information of thing
int getDestroyedThingsNumber()
Return number of dead things
RETURN - Number of dead things
int getThreadID(int thing_id)
Return a thread number
thing_id - thing number
RETURN - Thread id
int getThingStatus(int thing_id)
Return status of thing
thing_id - Thing number
RETURN - Status(TRUE, FALSE, ERROR, DESTROYED)
TCB* getThing(int thing_id)
Return TCB information of thing
thing_id - Thing number
RETURN - TCB information
TCB* getAllThings()
Return all TCB
RETURN - All TCB
pthread_mutex_t* getMutex(int thing_id)
Return mutex of thing
thing_id - Thing number
RETURN - mutex