#include "json.h"
#include "list.h"
#include "ofpbuf.h"
+#include "ovs-thread.h"
#include "poll-loop.h"
#include "reconnect.h"
#include "stream.h"
jsonrpc_recv_wait(struct jsonrpc *rpc)
{
if (rpc->status || rpc->received || !byteq_is_empty(&rpc->input)) {
- (poll_immediate_wake)(rpc->name);
+ poll_immediate_wake_at(rpc->name);
} else {
stream_recv_wait(rpc->stream);
}
static struct json *
jsonrpc_create_id(void)
{
- static unsigned int id;
- return json_integer_create(id++);
+ static atomic_uint next_id = ATOMIC_VAR_INIT(0);
+ unsigned int id;
+
+ atomic_add(&next_id, 1, &id);
+ return json_integer_create(id);
}
struct jsonrpc_msg *