共用方式為


send 函式

同步傳送作業,會等候直到目標接受或拒絕訊息。

template <
   class _Type
>
bool send(
   _Inout_ ITarget<_Type> * _Trg,
   const _Type& _Data
);

template <
   class _Type
>
bool send(
   ITarget<_Type> &_Trg,
   const _Type &_Data
);

參數

  • _Type
    承載類型。

  • _Trg
    資料傳送目標的指標或參考。

  • _Data
    要傳送的資料的參考。

傳回值

如果接受訊息則為 true,否則為 false

備註

如需詳細資訊,請參閱 訊息傳遞函式

需求

標頭: agents.h

Namespace: 並行存取

請參閱

參考

concurrency 命名空間

receive 函式

try_receive 函式

asend 函式