Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
53d71f7f
Unverified
Commit
53d71f7f
authored
Aug 02, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a WRK_BgThread-light for use with fellow_cache_test
parent
44d788bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
3 deletions
+86
-3
Makefile.am
src/Makefile.am
+5
-3
aux_cache_wrk.c
src/aux_cache_wrk.c
+81
-0
No files found.
src/Makefile.am
View file @
53d71f7f
...
...
@@ -299,9 +299,11 @@ endif
############################################################
## test programs
standalone_aux
=
aux_cache_wrk.c
fellow_log_test_ndebug_LDADD
=
libfellow.la
fellow_log_test_ndebug_CFLAGS
=
$(AM_CFLAGS)
$(DEV_CFLAGS)
$(XXHASH_CFLAGS)
-DTEST_DRIVER
fellow_log_test_ndebug_SOURCES
=
fellow_log_test.c
fellow_log_test_ndebug_SOURCES
=
$(standalone_aux)
fellow_log_test.c
fellow_log_test_LDFLAGS
=
$(fellow_log_test_ndebug_LDFLAGS)
fellow_log_test_LDADD
=
libfellowwitness.la
...
...
@@ -314,7 +316,7 @@ fellow_cache_test_LDFLAGS = $(fellow_log_test_ndebug_LDFLAGS)
fellow_cache_test_LDADD
=
libfellowwitness.la
fellow_cache_test_CFLAGS
=
$(fellow_log_test_ndebug_CFLAGS)
\
-DDEBUG
-DBUDDY_WITNESS
fellow_cache_test_SOURCES
=
fellow_cache.c
fellow_cache_test_SOURCES
=
$(standalone_aux)
fellow_cache.c
noinst_PROGRAMS
+=
\
fellow_log_dbg
\
...
...
@@ -451,4 +453,4 @@ dist_man_MANS = \
# XXX TODO flexelint fellow_io_*
flint
:
flexelint
$(VARNISHSRC_CFLAGS)
-I
.. flint.lnt
\
`
ls
*
.c |
grep
-vE
'fellow_io_aio|fellow_io_threads|fellow_log_test.c|slashmap.c'
`
`
ls
*
.c |
grep
-vE
'fellow_io_aio|fellow_io_threads|fellow_log_test.c|slashmap.c
|aux_
'
`
src/aux_cache_wrk.c
0 → 100644
View file @
53d71f7f
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include "config.h"
#include <stdlib.h>
#include <sched.h>
#include "cache/cache_varnishd.h"
/*
* stripped down version of Varnish-Cache WRK_BgThread for
* fellow_cache_test
*/
struct
bgthread
{
unsigned
magic
;
#define BGTHREAD_MAGIC 0x23b5152b
const
char
*
name
;
bgthread_t
*
func
;
void
*
priv
;
};
static
void
*
wrk_bgthread
(
void
*
arg
)
{
struct
bgthread
*
bt
;
struct
worker
wrk
;
struct
worker_priv
wpriv
[
1
];
void
*
r
;
CAST_OBJ_NOTNULL
(
bt
,
arg
,
BGTHREAD_MAGIC
);
INIT_OBJ
(
&
wrk
,
WORKER_MAGIC
);
INIT_OBJ
(
wpriv
,
WORKER_PRIV_MAGIC
);
wrk
.
wpriv
=
wpriv
;
r
=
bt
->
func
(
&
wrk
,
bt
->
priv
);
return
(
r
);
}
void
WRK_BgThread
(
pthread_t
*
thr
,
const
char
*
name
,
bgthread_t
*
func
,
void
*
priv
)
{
struct
bgthread
*
bt
;
ALLOC_OBJ
(
bt
,
BGTHREAD_MAGIC
);
AN
(
bt
);
bt
->
name
=
name
;
bt
->
func
=
func
;
bt
->
priv
=
priv
;
PTOK
(
pthread_create
(
thr
,
NULL
,
wrk_bgthread
,
bt
));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment