403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/include/isc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/include/isc/barrier.h
/*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * SPDX-License-Identifier: MPL-2.0
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

#pragma once

#include <isc/util.h>

#if HAVE_PTHREAD_BARRIER_INIT

#include <pthread.h>

#if ISC_TRACK_PTHREADS_OBJECTS
typedef pthread_barrier_t *isc_barrier_t;
#else
typedef pthread_barrier_t isc_barrier_t;
#endif

#define isc__barrier_init(bp, count)                                \
	{                                                           \
		int _ret = pthread_barrier_init(bp, NULL, count);   \
		PTHREADS_RUNTIME_CHECK(pthread_barrier_init, _ret); \
	}

#define isc__barrier_wait(bp) pthread_barrier_wait(bp)

#define isc__barrier_destroy(bp)                                       \
	{                                                              \
		int _ret = pthread_barrier_destroy(bp);                \
		PTHREADS_RUNTIME_CHECK(pthread_barrier_destroy, _ret); \
	}

#else

#include <uv.h>

#if ISC_TRACK_PTHREADS_OBJECTS
typedef uv_barrier_t *isc_barrier_t;
#else
typedef uv_barrier_t isc_barrier_t;
#endif

#define isc__barrier_init(bp, count)                     \
	{                                                \
		int _ret = uv_barrier_init(bp, count);   \
		UV_RUNTIME_CHECK(uv_barrier_init, _ret); \
	}

#define isc__barrier_wait(bp) uv_barrier_wait(bp)

#define isc__barrier_destroy(bp) uv_barrier_destroy(bp)

#endif

#if ISC_TRACK_PTHREADS_OBJECTS

#define isc_barrier_init(bp, count)            \
	{                                      \
		*bp = malloc(sizeof(**bp));    \
		isc__barrier_init(*bp, count); \
	}
#define isc_barrier_wait(bp) isc__barrier_wait(*bp)
#define isc_barrier_destroy(bp)            \
	{                                  \
		isc__barrier_destroy(*bp); \
		free(*bp);                 \
	}

#else /* ISC_TRACK_PTHREADS_OBJECTS */

#define isc_barrier_init(bp, count) isc__barrier_init(bp, count)
#define isc_barrier_wait(bp)	    isc__barrier_wait(bp)
#define isc_barrier_destroy(bp)	    isc__barrier_destroy(bp)

#endif /* ISC_TRACK_PTHREADS_OBJECTS */

Youez - 2016 - github.com/yon3zu
LinuXploit