Skip to content
Snippets Groups Projects
Commit b1dbcb73 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Now doesn't keep references to old data.

Rev: lib/modules/Thread.pmod:1.9
parent 77b28233
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,8 @@ class Fifo {
mixed tmp;
object key=lock::lock();
while(!num) r_cond::wait(key);
tmp=buffer[ptr++];
tmp=buffer[ptr];
buffer[ptr++] = 0; // Throw away any references.
ptr%=sizeof(buffer);
num--;
w_cond::signal();
......@@ -51,7 +52,8 @@ class Queue {
mixed tmp;
object key=lock::lock();
while(!size()) r_cond::wait(key);
tmp=buffer[r_ptr++];
tmp=buffer[r_ptr];
buffer[r_ptr++] = 0; // Throw away any references.
key=0;
return tmp;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment