int main(int argc, char **argv) {
XBT_INFO("Hello s4u, I'm ready to serve");
- char *msg = recvstr(*Mailbox::byName("worker"));
+ char *msg = (char*)recv(*Mailbox::byName("worker"));
XBT_INFO("I received '%s'",msg);
XBT_INFO("I'm done. See you.");
return 1;
void execute(double flop);
/** Block the actor until it gets a message from the given mailbox */
- //void* recv(const char *mailbox);
-
- /** Block the actor until it gets a string message (to be freed after use) from the given mailbox */
- char *recvstr(Mailbox &chan);
+ void *recv(Mailbox &chan);
/** Block the actor until it delivers a string message (that will be copied) to the given mailbox */
void sendstr(Mailbox &chan, const char*msg);
simcall_process_execute(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
}
-char *s4u::Actor::recvstr(Mailbox &chan) {
+void *s4u::Actor::recv(Mailbox &chan) {
void *res=NULL;
Comm c = Comm::recv_init(this, chan);
c.setDstData(&res,sizeof(res));
c.wait();
- return (char*)res;
+ return res;
}
void s4u::Actor::sendstr(Mailbox &chan, const char*msg) {
Comm c = Comm::send_init(this,chan);