pthreads :: PoolThread :: _cond
pthreads :: PoolThread :: _mutex
pthreads :: PoolThread :: _queue
pthreads :: PoolThread :: cond
pthreads :: PoolThread :: cond=
pthreads :: PoolThread :: defaultinit
pthreads :: PoolThread :: mutex
pthreads :: PoolThread :: mutex=
pthreads :: PoolThread :: queue
pthreads :: PoolThread :: queue=
pthreads $ PoolThread :: SELF
Type of this instance, automatically specialized in every classpthreads :: PoolThread :: _cond
pthreads :: PoolThread :: _mutex
pthreads :: PoolThread :: _queue
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
pthreads :: PoolThread :: cond
pthreads :: PoolThread :: cond=
pthreads :: PoolThread :: defaultinit
pthreads :: Thread :: defaultinit
core :: Object :: defaultinit
core :: Finalizable :: defaultinit
core :: Finalizable :: finalize
Liberate any resources held byself
before the memory holding self
is freed
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
pthreads :: Thread :: main_intern
pthreads :: PoolThread :: mutex
pthreads :: PoolThread :: mutex=
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).pthreads :: PoolThread :: queue
pthreads :: PoolThread :: queue=
# A Thread running in a threadpool
private class PoolThread
super Thread
var queue: ConcurrentList[Task]
var mutex: Mutex
var cond : NativePthreadCond
redef fun main do
loop
var t = null
mutex.lock
if queue.is_empty then cond.wait(mutex.native.as(not null))
if not queue.is_empty then
t = queue.shift
end
mutex.unlock
if t != null then
t.main
t.after_main
end
end
end
end
lib/pthreads/threadpool.nit:56,1--79,3