API Guides > ConceptRT 3.x
Blocking code checking

Detailed Description

Macros

#define RT_BLOCKING_CODE
 Macro to use to specify that the current context of execution can block the calling thread. For e.g. when waiting on OS event or Socket, etc. The mechanism behing will check in DEBUG only if the calling thread has the permission to be blocked. More...
 

Functions

bool IsAllowedBlockingCode ()
 Query if the context allows blocking code execution. More...
 
void CheckBlockingCodePermission (PCChar8 sourceFileLine)
 Check the consistency of the context of call regarding to the blocking code permission. More...
 

Macro Definition Documentation

#define RT_BLOCKING_CODE

Macro to use to specify that the current context of execution can block the calling thread. For e.g. when waiting on OS event or Socket, etc. The mechanism behing will check in DEBUG only if the calling thread has the permission to be blocked.

Version
3.2 : If the calling thread is TimeCritical, it will throw an exception with error code RT_ERROR_BLOCKING_CODE_NOT_ALLOWED.
3.3 or greater : The function CheckContextNonDeterministic is called and will bring a DebugMessage to the user application. Exception has been removed to be able to use this macro in destructors.

Function Documentation

void CheckBlockingCodePermission ( PCChar8  sourceFileLine)

Check the consistency of the context of call regarding to the blocking code permission.

The context of call is usually a thread. The function must ensure that it is allowed to execute code considered as blocking. This function will call ThreadUtils::CheckBlockingCodePermission that send a DebugMessage to the event ThreadUtils::DebugMessageEvent.

Parameters
sourceFileLineThe source file line.
Version
3.3 or greater feature
bool IsAllowedBlockingCode ( )

Query if the context allows blocking code execution.

Returns
True is yes, False if no.
Version
3.3 Move to the namespace RuntimeCheck.