mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Switch to <* *> docs. Fix issue with dynamically loaded C3 libs with other C3 code.
This commit is contained in:
committed by
Christoffer Lerno
parent
9f6a4eb300
commit
31cd839063
@@ -23,9 +23,9 @@ struct QueueItem @private
|
||||
void* arg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @require !self.initialized "ThreadPool must not be already initialized"
|
||||
**/
|
||||
<*
|
||||
@require !self.initialized "ThreadPool must not be already initialized"
|
||||
*>
|
||||
fn void! ThreadPool.init(&self)
|
||||
{
|
||||
defer catch @ok(self.destroy());
|
||||
@@ -40,19 +40,19 @@ fn void! ThreadPool.init(&self)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop all the threads and cleanup the pool.
|
||||
* Any pending work will be dropped.
|
||||
*/
|
||||
<*
|
||||
Stop all the threads and cleanup the pool.
|
||||
Any pending work will be dropped.
|
||||
*>
|
||||
fn void! ThreadPool.destroy(&self)
|
||||
{
|
||||
return self.@shutdown(stop_now);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop all the threads and cleanup the pool.
|
||||
* Any pending work will be processed.
|
||||
*/
|
||||
<*
|
||||
Stop all the threads and cleanup the pool.
|
||||
Any pending work will be processed.
|
||||
*>
|
||||
fn void! ThreadPool.stop_and_destroy(&self)
|
||||
{
|
||||
return self.@shutdown(stop);
|
||||
@@ -82,10 +82,10 @@ macro void! ThreadPool.@shutdown(&self, #stop) @private
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Push a new job to the pool.
|
||||
* Returns whether the queue is full, in which case the job is ignored.
|
||||
*/
|
||||
<*
|
||||
Push a new job to the pool.
|
||||
Returns whether the queue is full, in which case the job is ignored.
|
||||
*>
|
||||
fn void! ThreadPool.push(&self, ThreadFn func, void* arg)
|
||||
{
|
||||
while (true)
|
||||
|
||||
Reference in New Issue
Block a user