Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek wait_event_funcs.c   Interaktion und
PortierbarkeitC

 

/*------------------------------------------------------------------------
 *
 * wait_event_funcs.c
 *   Functions for accessing wait event data.
 *
 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 *
 * IDENTIFICATION
 *   src/backend/utils/activity/wait_event_funcs.c
 *
 *------------------------------------------------------------------------
 */

#include "postgres.h"

#include "funcapi.h"
#include "utils/builtins.h"
#include "utils/wait_event.h"

/*
 * Each wait event has one corresponding entry in this structure, fed to
 * the SQL function of this file.
 */

static const struct
{
 const char *type;
 const char *name;
 const char *description;
}

   waitEventData[] =
{
#include "utils/wait_event_funcs_data.c"
 /* end of list */
 {NULL, NULL, NULL}
};


/*
 * pg_get_wait_events
 *
 * List information about wait events (type, name and description).
 */

Datum
pg_get_wait_events(PG_FUNCTION_ARGS)
{
#define PG_GET_WAIT_EVENTS_COLS 3
 ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
 char   **waiteventnames;
 int   nbwaitevents;

 /* Build tuplestore to hold the result rows */
 InitMaterializedSRF(fcinfo, 0);

 /* Iterate over the list of wait events */
 for (int idx = 0; waitEventData[idx].type != NULL; idx++)
 {
  Datum  values[PG_GET_WAIT_EVENTS_COLS] = {0};
  bool  nulls[PG_GET_WAIT_EVENTS_COLS] = {0};

  values[0] = CStringGetTextDatum(waitEventData[idx].type);
  values[1] = CStringGetTextDatum(waitEventData[idx].name);
  values[2] = CStringGetTextDatum(waitEventData[idx].description);

  tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
 }

 /* Handle custom wait events for extensions */
 waiteventnames = GetWaitEventCustomNames(PG_WAIT_EXTENSION,
            &nbwaitevents);

 for (int idx = 0; idx < nbwaitevents; idx++)
 {
  StringInfoData buf;
  Datum  values[PG_GET_WAIT_EVENTS_COLS] = {0};
  bool  nulls[PG_GET_WAIT_EVENTS_COLS] = {0};


  values[0] = CStringGetTextDatum("Extension");
  values[1] = CStringGetTextDatum(waiteventnames[idx]);

  initStringInfo(&buf);
  appendStringInfo(&buf,
       "Waiting for custom wait event \"%s\" defined by extension module",
       waiteventnames[idx]);

  values[2] = CStringGetTextDatum(buf.data);

  tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
 }

 /* Likewise for injection points */
 waiteventnames = GetWaitEventCustomNames(PG_WAIT_INJECTIONPOINT,
            &nbwaitevents);

 for (int idx = 0; idx < nbwaitevents; idx++)
 {
  StringInfoData buf;
  Datum  values[PG_GET_WAIT_EVENTS_COLS] = {0};
  bool  nulls[PG_GET_WAIT_EVENTS_COLS] = {0};


  values[0] = CStringGetTextDatum("InjectionPoint");
  values[1] = CStringGetTextDatum(waiteventnames[idx]);

  initStringInfo(&buf);
  appendStringInfo(&buf,
       "Waiting for injection point \"%s\"",
       waiteventnames[idx]);

  values[2] = CStringGetTextDatum(buf.data);

  tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
 }

 return (Datum) 0;
}

Messung V0.5 in Prozent
C=92 H=89 G=90

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-27) ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691