diff options
| author | hiddenalpha.ch | 2026-10-02 00:15:09 +0200 |
|---|---|---|
| committer | hiddenalpha.ch | 2026-10-02 00:15:09 +0200 |
| commit | b5afa8ffae12f5681cfc1c7dbf8f5510ea56b503 (patch) | |
| tree | 7e31f01276797f3723b5934bcbd4ec5e455a141e /include/qntan/Qntan.h | |
| parent | a03520525ad4839861fc9fac2f07904937e77067 (diff) | |
| download | Qntan-b5afa8ffae12f5681cfc1c7dbf8f5510ea56b503.tar.gz Qntan-b5afa8ffae12f5681cfc1c7dbf8f5510ea56b503.zip | |
Make `EvLoop` better compatible with `Executor`.
Diffstat (limited to 'include/qntan/Qntan.h')
| -rw-r--r-- | include/qntan/Qntan.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 1fc5cab..bb19954 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -146,6 +146,11 @@ struct Qntan_EvLoop { struct Qntan_EvLoop**, void(*fn)(Qntan_Cls), Qntan_Cls ); /* enque a task to the EvLoop. See also Qntan_ThreadPool.enque(). */ + int (*isMyThread)( struct Qntan_EvLoop** ); + /* returns positive, if calling thread belongs to this EventLoop. + * Zero if not. Negative values are reserved. + * (idea is to have the same method as an `Executor` has) + */ void (*addAwaitToken)( struct Qntan_EvLoop** ); /* TODO write doc */ @@ -162,6 +167,7 @@ struct Qntan_EvLoop { int (*isEvLoopThread)( struct Qntan_EvLoop** ); /* returns NON-zero, if called from the EvLoopThread. This is intended for * assertions, to check that one is running on the expected thread. + * TODO: OBSOLETE, use `isMyThread()` */ }; @@ -252,6 +258,10 @@ struct Qntan_Executor { * executor instance got chosen. This also includes stuff like ThreadPools * which may execute stuff out of order. */ + int (*isMyThread)( struct Qntan_Executor** ); + /* returns positive, if calling thread belongs to this executor. + * Zero if not. Negative values are reserved. + */ }; |
