summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
19dae42)
- Same bug as threads had months ago :/
- * AcessOS Microkernel Version
+ * Acess2 Kernel
+ * - By John Hodge (thePowersGang)
+ *
#include <acess.h>
#include <threads.h>
#include <threads_int.h>
#include <acess.h>
#include <threads.h>
#include <threads_int.h>
int ret;
void *tmp;
tThread *cur = Proc_GetCurThread();
int ret;
void *tmp;
tThread *cur = Proc_GetCurThread();
+
+ ENTER("pSource pBuffer", Source, Buffer);
// Check if queue has any items
if(!cur->Messages) {
// Check if queue has any items
if(!cur->Messages) {
return 0;
}
SHORTLOCK( &cur->IsLocked );
return 0;
}
SHORTLOCK( &cur->IsLocked );
*Source = cur->Messages->Source;
*Source = cur->Messages->Source;
+ LOG("*Source = %i", *Source);
+ }
// Get message length
if( !Buffer ) {
ret = cur->Messages->Length;
SHORTREL( &cur->IsLocked );
// Get message length
if( !Buffer ) {
ret = cur->Messages->Length;
SHORTREL( &cur->IsLocked );
{
if( !CheckMem( Buffer, cur->Messages->Length ) )
{
{
if( !CheckMem( Buffer, cur->Messages->Length ) )
{
*Err = -EINVAL;
SHORTREL( &cur->IsLocked );
*Err = -EINVAL;
SHORTREL( &cur->IsLocked );
+ LOG("Copied to buffer");
memcpy(Buffer, cur->Messages->Data, cur->Messages->Length);
}
ret = cur->Messages->Length;
memcpy(Buffer, cur->Messages->Data, cur->Messages->Length);
}
ret = cur->Messages->Length;
// Remove from list
tmp = cur->Messages;
cur->Messages = cur->Messages->Next;
// Remove from list
tmp = cur->Messages;
cur->Messages = cur->Messages->Next;
+ if(cur->Messages == NULL) cur->LastMessage = NULL;
SHORTREL( &cur->IsLocked );
free(tmp); // Free outside of lock
SHORTREL( &cur->IsLocked );
free(tmp); // Free outside of lock