Skip to content

Commit

Permalink
runtime: save now on RPC
Browse files Browse the repository at this point in the history
sbourdeauducq committed Jun 24, 2016
1 parent 1bee5bb commit 9dd88f8
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions artiq/runtime/ksupport.c
Original file line number Diff line number Diff line change
@@ -475,6 +475,7 @@ void send_rpc(int service, const char *tag, ...)
{
struct msg_rpc_send request;

request.now = now;
if(service != 0)
request.type = MESSAGE_TYPE_RPC_SEND;
else
1 change: 1 addition & 0 deletions artiq/runtime/messages.h
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ struct msg_watchdog_clear {

struct msg_rpc_send {
int type;
long long int now;
int service;
const char *tag;
va_list args;
6 changes: 6 additions & 0 deletions artiq/runtime/session.c
Original file line number Diff line number Diff line change
@@ -983,6 +983,12 @@ static int process_kmsg(struct msg_base *umsg)
case MESSAGE_TYPE_RPC_BATCH: {
struct msg_rpc_send *msg = (struct msg_rpc_send *)umsg;

/*
* save now in case the RPC stops the kernel
* (e.g. pause with preemption)
*/
now = msg->now;

if(!send_rpc_request(msg->service, msg->tag, msg->args)) {
core_log("Failed to send RPC request (service %d, tag %s)\n",
msg->service, msg->tag);

0 comments on commit 9dd88f8

Please sign in to comment.