bind9/lib/isc/include/isc/work.h
Ondřej Surý 06f9163d51
Remove C++ support from the public header
Since BIND 9 headers are not longer public, there's no reason to keep
the ISC_LANG_BEGINDECL and ISC_LANG_ENDDECL macros to support including
them from C++ projects.
2024-12-18 13:10:39 +01:00

36 lines
1.1 KiB
C

/*
* 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 <stdlib.h>
#include <isc/loop.h>
typedef void (*isc_work_cb)(void *arg);
typedef void (*isc_after_work_cb)(void *arg);
typedef struct isc_work isc_work_t;
void
isc_work_enqueue(isc_loop_t *loop, isc_work_cb work_cb,
isc_after_work_cb after_work_cb, void *cbarg);
/*%<
* Schedules work to be handled by the libuv thread pool (see uv_work_t).
* The function specified in `work_cb` will be run by a thread in the
* thread pool; when complete, the `after_work_cb` function will run
* in 'loop' to inform the caller that the work was completed.
*
* Requires:
* \li 'loop' is a valid event loop.
* \li 'work_cb' and 'after_work_cb' are not NULL.
*/