Created
May 27, 2015 04:11
-
-
Save aerodame/592410554ec02bab1f8b to your computer and use it in GitHub Desktop.
TCB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TCB { | |
private Thread thread = null; | |
private int tid = 0; | |
private int pid = 0; | |
private boolean terminate = false; | |
// User file descriptor table: | |
// each entry pointing to a file (structure) table entry | |
public FileTableEntry[] ftEnt = null; | |
public TCB( Thread newThread, int myTid, int parentTid ) { | |
thread = newThread; | |
tid = myTid; | |
pid = parentTid; | |
terminated = false; | |
// The following code is added for the file system | |
ftEnt = new FileTableEntry[32]; | |
for ( int i = 0; i < 32; i++ ) | |
ftEnt[i] = null; // all entries initialized to null | |
// fd[0], fd[1], and fd[2] are kept null. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment