thread_pool_run: nontermination checks at any type So claim to return an int to appease the compiler's warning about compartment calls.
diff --git a/sdk/include/thread_pool.h b/sdk/include/thread_pool.h index c5e5d3c..cd5e4d4 100644 --- a/sdk/include/thread_pool.h +++ b/sdk/include/thread_pool.h
@@ -45,10 +45,10 @@ thread_pool_async(ThreadPoolCallback fn, void *data); /** - * Run a thread pool. This does not return and can be used as a thread entry - * point. + * Run a thread pool. This does not return, despite the claimed type, and can + * be used as a thread entry point. */ -void __cheri_compartment("thread_pool") thread_pool_run(void); +int __cheri_compartment("thread_pool") thread_pool_run(void); __END_DECLS #ifdef __cplusplus
diff --git a/sdk/lib/thread_pool/thread_pool.cc b/sdk/lib/thread_pool/thread_pool.cc index f58fcf9..5b8b305 100644 --- a/sdk/lib/thread_pool/thread_pool.cc +++ b/sdk/lib/thread_pool/thread_pool.cc
@@ -47,7 +47,7 @@ return 0; } -void __cheri_compartment("thread_pool") thread_pool_run() +int __cheri_compartment("thread_pool") thread_pool_run() { while (true) {