struct afb_stub_ws;
-/*
- * structure for recording calls on client side
- */
-struct client_call {
- struct client_call *next; /* the next call */
- struct afb_stub_ws *stubws; /* the stub_ws */
- struct afb_xreq *xreq; /* the request handle */
- uint32_t msgid; /* the message identifier */
-};
-
/*
* structure for a ws request
*/
{
struct server_session *s, *n;
- s = stubws->sessions;
- stubws->sessions = NULL;
+ s = __atomic_exchange_n(&stubws->sessions, NULL, __ATOMIC_RELAXED);
while(s) {
n = s->next;
afb_session_unref(s->session);
__atomic_add_fetch(&stubws->refcount, 1, __ATOMIC_RELAXED);
}
-void afb_stub_ws_on_hangup(struct afb_stub_ws *stubws, void (*on_hangup)(struct afb_stub_ws*))
+void afb_stub_ws_set_on_hangup(struct afb_stub_ws *stubws, void (*on_hangup)(struct afb_stub_ws*))
{
stubws->on_hangup = on_hangup;
}