Deprecate foo.#bar.

This commit is contained in:
Christoffer Lerno
2025-06-05 12:51:35 +02:00
parent 7f85534414
commit c9d9127da6
10 changed files with 33 additions and 35 deletions

View File

@@ -61,7 +61,7 @@ fn void? FixedThreadPool.init(&self, usz threads, usz queue_size = 0)
*>
fn void? FixedThreadPool.destroy(&self)
{
return self.@shutdown(stop_now);
return self.@shutdown(self.stop_now);
}
<*
@@ -70,7 +70,7 @@ fn void? FixedThreadPool.destroy(&self)
*>
fn void? FixedThreadPool.stop_and_destroy(&self)
{
return self.@shutdown(stop);
return self.@shutdown(self.stop);
}
macro void? FixedThreadPool.@shutdown(&self, #stop) @private
@@ -78,7 +78,7 @@ macro void? FixedThreadPool.@shutdown(&self, #stop) @private
if (self.initialized)
{
self.mu.lock()!;
self.#stop = true;
#stop = true;
self.notify.broadcast()!;
self.mu.unlock()!;
// Wait for all threads to shutdown.

View File

@@ -7,7 +7,8 @@ struct ThreadPool
QueueItem[SIZE] queue;
usz qindex;
usz num_threads;
bitstruct : char {
bitstruct : char
{
bool initialized;
bool stop;
bool stop_now;
@@ -46,7 +47,7 @@ fn void? ThreadPool.init(&self)
*>
fn void? ThreadPool.destroy(&self)
{
return self.@shutdown(stop_now);
return self.@shutdown(self.stop_now);
}
<*
@@ -55,7 +56,7 @@ fn void? ThreadPool.destroy(&self)
*>
fn void? ThreadPool.stop_and_destroy(&self)
{
return self.@shutdown(stop);
return self.@shutdown(self.stop);
}
macro void? ThreadPool.@shutdown(&self, #stop) @private
@@ -63,7 +64,7 @@ macro void? ThreadPool.@shutdown(&self, #stop) @private
if (self.initialized)
{
self.mu.lock()!;
self.#stop = true;
#stop = true;
self.notify.broadcast()!;
self.mu.unlock()!;
// Wait for all threads to shutdown.