git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfixing
[tpg/acess2.git]
/
Kernel
/
threads.c
diff --git
a/Kernel/threads.c
b/Kernel/threads.c
index
87d30d3
..
956eede
100644
(file)
--- a/
Kernel/threads.c
+++ b/
Kernel/threads.c
@@
-9,6
+9,7
@@
#include <errno.h>
#include <hal_proc.h>
#include <semaphore.h>
#include <errno.h>
#include <hal_proc.h>
#include <semaphore.h>
+#include <vfs_threads.h> // VFS Handle maintainence
// Configuration
#define DEBUG_TRACE_TICKETS 0 // Trace ticket counts
// Configuration
#define DEBUG_TRACE_TICKETS 0 // Trace ticket counts
@@
-151,11
+152,16
@@
void Threads_Delete(tThread *Thread)
if( Thread->Process->nThreads == 0 )
{
tProcess *proc = Thread->Process;
if( Thread->Process->nThreads == 0 )
{
tProcess *proc = Thread->Process;
+ // VFS Cleanup
+ VFS_CloseAllUserHandles();
+ // Architecture cleanup
Proc_ClearProcess( proc );
Proc_ClearProcess( proc );
+ // VFS Configuration strings
if( proc->CurrentWorkingDir)
free( proc->CurrentWorkingDir );
if( proc->RootDir )
free( proc->RootDir );
if( proc->CurrentWorkingDir)
free( proc->CurrentWorkingDir );
if( proc->RootDir )
free( proc->RootDir );
+ // Process descriptor
free( proc );
}
free( proc );
}
@@
-319,6
+325,8
@@
tThread *Threads_CloneTCB(Uint Flags)
else
newproc->RootDir = NULL;
newproc->nThreads = 1;
else
newproc->RootDir = NULL;
newproc->nThreads = 1;
+ // Reference all handles in the VFS
+ VFS_ReferenceUserHandles();
}
else {
new->Process->nThreads ++;
}
else {
new->Process->nThreads ++;
UCC
git Repository :: git.ucc.asn.au