[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: supercollider:[8229] trunk/build/SCClassLibrary/Common/Core/ Semaphore.sc
Revision: 8229
http://supercollider.svn.sourceforge.net/supercollider/?rev=8229&view=rev
Author: jrhb
Date: 2008-12-21 19:32:07 +0000 (Sun, 21 Dec 2008)
Log Message:
-----------
simplify Semaphore implementation
Modified Paths:
--------------
trunk/build/SCClassLibrary/Common/Core/Semaphore.sc
Modified: trunk/build/SCClassLibrary/Common/Core/Semaphore.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Core/Semaphore.sc 2008-12-21 19:31:40 UTC (rev 8228)
+++ trunk/build/SCClassLibrary/Common/Core/Semaphore.sc 2008-12-21 19:32:07 UTC (rev 8229)
@@ -1,5 +1,4 @@
-Semaphore
-{
+Semaphore {
var <count, waitingThreads;
*new { | count=1 |
@@ -12,12 +11,12 @@
if (count > 0) {
count = count - 1;
} {
- waitingThreads = waitingThreads.add(thisThread);
+ waitingThreads.add(thisThread);
nil.yield;
};
}
signal {
- var thread, time;
+ var thread;
count = count + 1;
thread = waitingThreads.popFirst;
if (thread.notNil) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/