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
Kernel - Implemented select(), partially debugged
[tpg/acess2.git]
/
Kernel
/
threads.c
diff --git
a/Kernel/threads.c
b/Kernel/threads.c
index
dc79908
..
b5ce191
100644
(file)
--- a/
Kernel/threads.c
+++ b/
Kernel/threads.c
@@
-725,7
+725,7
@@
int Threads_Wake(tThread *Thread)
switch(Thread->Status)
{
case THREAD_STAT_ACTIVE:
switch(Thread->Status)
{
case THREAD_STAT_ACTIVE:
- Log("Thread
_Wake:
Waking awake thread (%i)", Thread->TID);
+ Log("Thread
s_Wake -
Waking awake thread (%i)", Thread->TID);
return -EALREADY;
case THREAD_STAT_SLEEPING:
return -EALREADY;
case THREAD_STAT_SLEEPING:
@@
-742,15
+742,15
@@
int Threads_Wake(tThread *Thread)
return -EOK;
case THREAD_STAT_WAITING:
return -EOK;
case THREAD_STAT_WAITING:
- Warning("Thread_Wake - Waiting threads are not currently supported");
+ Warning("Thread
s
_Wake - Waiting threads are not currently supported");
return -ENOTIMPL;
case THREAD_STAT_DEAD:
return -ENOTIMPL;
case THREAD_STAT_DEAD:
- Warning("Thread_Wake - Attempt to wake dead thread (%i)", Thread->TID);
+ Warning("Thread
s
_Wake - Attempt to wake dead thread (%i)", Thread->TID);
return -ENOTIMPL;
default:
return -ENOTIMPL;
default:
- Warning("Thread_Wake - Unknown process status (%i)\n", Thread->Status);
+ Warning("Thread
s
_Wake - Unknown process status (%i)\n", Thread->Status);
return -EINTERNAL;
}
}
return -EINTERNAL;
}
}
@@
-1312,6
+1312,7
@@
int Mutex_Acquire(tMutex *Mutex)
/**
* \brief Release a held mutex
* \param Mutex Mutex to release
/**
* \brief Release a held mutex
* \param Mutex Mutex to release
+ * \note Releasing a non-held mutex has no effect
*/
void Mutex_Release(tMutex *Mutex)
{
*/
void Mutex_Release(tMutex *Mutex)
{
@@
-1359,9
+1360,11
@@
int Mutex_IsLocked(tMutex *Mutex)
//
void Semaphore_Init(tSemaphore *Sem, int Value, int MaxValue, const char *Module, const char *Name)
{
//
void Semaphore_Init(tSemaphore *Sem, int Value, int MaxValue, const char *Module, const char *Name)
{
+ memset(Sem, 0, sizeof(tSemaphore));
Sem->Value = Value;
Sem->ModName = Module;
Sem->Name = Name;
Sem->Value = Value;
Sem->ModName = Module;
Sem->Name = Name;
+ Sem->MaxValue = MaxValue;
}
//
// Wait for items to be avaliable
}
//
// Wait for items to be avaliable
UCC
git Repository :: git.ucc.asn.au