Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/plugin/handler_socket/libhsclient/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 858 B image not shown  

Quelle  mutex.hpp   Sprache: C

 


// vim:sw=2:ai

/*
 * Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved.
 * See COPYRIGHT.txt for details.
 */


#ifndef DENA_MUTEX_HPP
#define DENA_MUTEX_HPP

#include <pthread.h>
#include <stdlib.h>

#include "fatal.hpp"
#include "util.hpp"

namespace dena {

struct condition;

struct mutex : private noncopyable {
  friend struct condition;
  mutex() {
    if (pthread_mutex_init(&mtx, 0) != 0) {
      fatal_abort("pthread_mutex_init");
    }
  }
  ~mutex() {
    if (pthread_mutex_destroy(&mtx) != 0) {
      fatal_abort("pthread_mutex_destroy");
    }
  }
  void lock() const {
    if (pthread_mutex_lock(&mtx) != 0) {
      fatal_abort("pthread_mutex_lock");
    }
  }
  void unlock() const {
    if (pthread_mutex_unlock(&mtx) != 0) {
      fatal_abort("pthread_mutex_unlock");
    }
  }
 private:
  mutable pthread_mutex_t mtx;
};

};

#endif


Messung V0.5 in Prozent
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.33 Sekunden  (vorverarbeitet am  2026-10-08) ¤

*© Formatika GbR, Deutschland






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.