GNUnet  0.11.x
Data Structures | Functions
pq.h File Reference

shared internal data structures of libgnunetpq More...

#include "gnunet_util_lib.h"
#include "gnunet_pq_lib.h"
Include dependency graph for pq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_PQ_Context
 Handle to Postgres database. More...
 

Functions

void GNUNET_PQ_event_reconnect_ (struct GNUNET_PQ_Context *db)
 Internal API. More...
 

Detailed Description

shared internal data structures of libgnunetpq

Author
Christian Grothoff

Definition in file pq.h.

Function Documentation

◆ GNUNET_PQ_event_reconnect_()

void GNUNET_PQ_event_reconnect_ ( struct GNUNET_PQ_Context db)

Internal API.

Reconnect should re-register notifications after a disconnect.

Parameters
dbthe DB handle

Definition at line 398 of file pq_event.c.

References GNUNET_PQ_Context::channel_map, GNUNET_assert, GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_PQ_Context::notify_lock, and register_notify().

Referenced by GNUNET_PQ_reconnect().

399 {
400  GNUNET_assert (0 ==
401  pthread_mutex_lock (&db->notify_lock));
404  db);
405  GNUNET_assert (0 ==
406  pthread_mutex_unlock (&db->notify_lock));
407 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
pthread_mutex_t notify_lock
Lock to access channel_map.
Definition: pq.h:79
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
static int register_notify(void *cls, const struct GNUNET_ShortHashCode *sh, void *value)
Re-subscribe to notifications after disconnect.
Definition: pq_event.c:383
struct GNUNET_CONTAINER_MultiShortmap * channel_map
Map managing event subscriptions.
Definition: pq.h:74
Here is the call graph for this function:
Here is the caller graph for this function: