mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'subsystems'
This commit is contained in:
@@ -2,6 +2,7 @@ orconfig.h
|
||||
lib/cc/*.h
|
||||
lib/lock/*.h
|
||||
lib/log/*.h
|
||||
lib/subsys/*.h
|
||||
lib/testsupport/*.h
|
||||
lib/thread/*.h
|
||||
lib/wallclock/*.h
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
#include "orconfig.h"
|
||||
#include <stdlib.h>
|
||||
#include "lib/thread/threads.h"
|
||||
#include "lib/thread/thread_sys.h"
|
||||
|
||||
#include "lib/log/log.h"
|
||||
#include "lib/log/util_bug.h"
|
||||
#include "lib/subsys/subsys.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -109,3 +111,17 @@ atomic_counter_exchange(atomic_counter_t *counter, size_t newval)
|
||||
return oldval;
|
||||
}
|
||||
#endif /* !defined(HAVE_WORKING_STDATOMIC) */
|
||||
|
||||
static int
|
||||
subsys_threads_initialize(void)
|
||||
{
|
||||
tor_threads_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const subsys_fns_t sys_threads = {
|
||||
.name = "threads",
|
||||
.supported = true,
|
||||
.level = -95,
|
||||
.initialize = subsys_threads_initialize,
|
||||
};
|
||||
|
||||
@@ -23,5 +23,6 @@ src_lib_libtor_thread_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
|
||||
src_lib_libtor_thread_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
|
||||
|
||||
noinst_HEADERS += \
|
||||
src/lib/thread/threads.h \
|
||||
src/lib/thread/numcpus.h
|
||||
src/lib/thread/numcpus.h \
|
||||
src/lib/thread/thread_sys.h \
|
||||
src/lib/thread/threads.h
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Copyright (c) 2018, The Tor Project, Inc. */
|
||||
/* See LICENSE for licensing information */
|
||||
|
||||
/**
|
||||
* \file threads_sys.h
|
||||
* \brief Declare subsystem object for threads library
|
||||
**/
|
||||
|
||||
#ifndef TOR_THREADS_SYS_H
|
||||
#define TOR_THREADS_SYS_H
|
||||
|
||||
extern const struct subsys_fns_t sys_threads;
|
||||
|
||||
#endif /* !defined(TOR_THREADS_SYS_H) */
|
||||
Reference in New Issue
Block a user