nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests & lib/realtime: rewrite test as a nitunit
[nit.git]
/
lib
/
pthreads
/
concurrent_collections.nit
diff --git
a/lib/pthreads/concurrent_collections.nit
b/lib/pthreads/concurrent_collections.nit
index
6df0ea5
..
e0c53af
100644
(file)
--- a/
lib/pthreads/concurrent_collections.nit
+++ b/
lib/pthreads/concurrent_collections.nit
@@
-161,10
+161,10
@@
abstract class ConcurrentCollection[E]
return r
end
return r
end
- redef fun join(sep)
+ redef fun join(sep, last_sep)
do
mutex.lock
do
mutex.lock
- var r = real_collection.join(sep)
+ var r = real_collection.join(sep, last_sep)
mutex.unlock
return r
end
mutex.unlock
return r
end
@@
-492,4
+492,19
@@
class ConcurrentList[E]
real_collection.unshift(e)
mutex.unlock
end
real_collection.unshift(e)
mutex.unlock
end
+
+ redef fun push(e)
+ do
+ mutex.lock
+ real_collection.push(e)
+ mutex.unlock
+ end
+
+ redef fun shift
+ do
+ mutex.lock
+ var value = real_collection.shift
+ mutex.unlock
+ return value
+ end
end
end