+tThread *Threads_RemActive(void)
+{
+ return lpThreads_This;
+}
+
+void Threads_AddActive(tThread *Thread)
+{
+ Thread->Status = THREAD_STAT_ACTIVE;
+ // Increment state-change semaphore
+ Threads_int_SemSignal(Thread->WaitSemaphore);
+}
+
+struct sProcess *Threads_int_CreateProcess(void)
+{
+ struct sProcess *ret = calloc(sizeof(struct sProcess), 1);
+
+ ret->MaxFDs = 32;
+
+ return ret;
+}
+
+tThread *Threads_int_CreateTCB(tThread *Parent)
+{
+ tThread *ret = calloc( sizeof(tThread), 1 );
+ ret->TID = giThreads_NextTID ++;
+ ret->WaitSemaphore = Threads_int_SemCreate();
+ //ret->Protector = Threads_int_MutexCreate();
+
+ if( !Parent )
+ {
+ ret->Process = Threads_int_CreateProcess();
+ }
+ else
+ ret->Process = Parent->Process;
+
+ ret->ProcNext = ret->Process->Threads;
+ ret->Process->Threads = ret;
+
+ ret->Next = gThreads_List;
+ gThreads_List = ret;
+
+ return ret;
+}
+