diff options
| -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. + */ }; |
