in inc/sf_c_util/fabric_async_op_sync_wrapper.h [219:245]
static void MU_C4(interface_name, _, operation_name, sync_wrapper_cb)(void* context, IFabricAsyncOperationContext* fabric_async_operation_context) \
{ \
if ( \
/* Codes_SRS_FABRIC_ASYNC_OP_SYNC_WRAPPER_01_015: [ If context is NULL, _sync_wrapper_cb shall terminate the process. ]*/ \
(context == NULL) || \
/* Codes_SRS_FABRIC_ASYNC_OP_SYNC_WRAPPER_01_016: [ If fabric_async_operation_context is NULL, _sync_wrapper_cb shall terminate the process. ]*/ \
(fabric_async_operation_context == NULL) \
) \
{ \
LogCriticalAndTerminate("Invalid arguments: void* context=%p, IFabricAsyncOperationContext* fabric_async_operation_context=%p", context, fabric_async_operation_context); \
} \
else \
{ \
/* Codes_SRS_FABRIC_ASYNC_OP_SYNC_WRAPPER_01_017: [ Otherwise, _sync_wrapper_cb shall check whether the async operation has completed synchronously. ]*/ \
if (fabric_async_operation_context->lpVtbl->CompletedSynchronously(fabric_async_operation_context)) \
{ \
/* Codes_SRS_FABRIC_ASYNC_OP_SYNC_WRAPPER_01_018: [ If the async operation has completed synchronously, _sync_wrapper_cb shall return. ]*/ \
} \
else \
{ \
/* Codes_SRS_FABRIC_ASYNC_OP_SYNC_WRAPPER_01_019: [ If the async operation has not completed synchronously _sync_wrapper_cb shall signal to unblock _execute. ]*/ \
volatile_atomic int32_t* is_completed = (volatile_atomic int32_t*)context; \
(void)interlocked_exchange(is_completed, 1); \
wake_by_address_single(is_completed); \
} \
} \
} \