Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
7fc7fa7d
Commit
7fc7fa7d
authored
Jan 23, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the "schedule a session" code from cache_pool to cache_session
where it rightfully belongs.
parent
f965f4df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
20 deletions
+42
-20
cache.h
bin/varnishd/cache/cache.h
+2
-0
cache_pool.c
bin/varnishd/cache/cache_pool.c
+4
-20
cache_session.c
bin/varnishd/cache/cache_session.c
+36
-0
No files found.
bin/varnishd/cache/cache.h
View file @
7fc7fa7d
...
@@ -942,6 +942,8 @@ int SES_Schedule(struct sess *sp);
...
@@ -942,6 +942,8 @@ int SES_Schedule(struct sess *sp);
void
SES_Handle
(
struct
sess
*
sp
,
double
now
);
void
SES_Handle
(
struct
sess
*
sp
,
double
now
);
void
SES_GetReq
(
struct
sess
*
sp
);
void
SES_GetReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
sess
*
sp
);
pool_func_t
SES_pool_task
;
/* cache_shmlog.c */
/* cache_shmlog.c */
extern
struct
VSC_C_main
*
VSC_C_main
;
extern
struct
VSC_C_main
*
VSC_C_main
;
...
...
bin/varnishd/cache/cache_pool.c
View file @
7fc7fa7d
...
@@ -186,6 +186,8 @@ Pool_Task(struct pool *pp, struct pool_task *task, enum pool_how how)
...
@@ -186,6 +186,8 @@ Pool_Task(struct pool *pp, struct pool_task *task, enum pool_how how)
int
retval
=
0
;
int
retval
=
0
;
CHECK_OBJ_NOTNULL
(
pp
,
POOL_MAGIC
);
CHECK_OBJ_NOTNULL
(
pp
,
POOL_MAGIC
);
AN
(
task
);
AN
(
task
->
func
);
Lck_Lock
(
&
pp
->
mtx
);
Lck_Lock
(
&
pp
->
mtx
);
...
@@ -257,6 +259,7 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
...
@@ -257,6 +259,7 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
if
(
tp
!=
NULL
)
{
if
(
tp
!=
NULL
)
{
Lck_Unlock
(
&
pp
->
mtx
);
Lck_Unlock
(
&
pp
->
mtx
);
AN
(
tp
->
func
);
tp
->
func
(
pp
,
wrk
,
tp
->
priv
);
tp
->
func
(
pp
,
wrk
,
tp
->
priv
);
stats_clean
=
WRK_TrySumStat
(
wrk
);
stats_clean
=
WRK_TrySumStat
(
wrk
);
Lck_Lock
(
&
pp
->
mtx
);
Lck_Lock
(
&
pp
->
mtx
);
...
@@ -316,27 +319,8 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
...
@@ -316,27 +319,8 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
}
}
if
(
wrk
->
do_what
==
pool_do_sess
)
{
if
(
wrk
->
do_what
==
pool_do_sess
)
{
CHECK_OBJ_NOTNULL
(
wrk
->
sp
,
SESS_MAGIC
);
AZ
(
wrk
->
ws
->
r
);
stats_clean
=
0
;
stats_clean
=
0
;
wrk
->
lastused
=
NAN
;
SES_pool_task
(
pp
,
wrk
,
wrk
->
sp
);
AZ
(
wrk
->
sp
->
wrk
);
THR_SetSession
(
wrk
->
sp
);
wrk
->
sp
->
wrk
=
wrk
;
CNT_Session
(
wrk
->
sp
);
THR_SetSession
(
NULL
);
wrk
->
sp
=
NULL
;
WS_Assert
(
wrk
->
ws
);
AZ
(
wrk
->
busyobj
);
AZ
(
wrk
->
wrw
.
wfd
);
assert
(
wrk
->
wlp
==
wrk
->
wlb
);
if
(
cache_param
->
diag_bitmap
&
0x00040000
)
{
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
}
}
else
if
(
wrk
->
do_what
==
pool_do_nothing
)
{
}
else
if
(
wrk
->
do_what
==
pool_do_nothing
)
{
/* we already did */
/* we already did */
}
else
{
}
else
{
...
...
bin/varnishd/cache/cache_session.c
View file @
7fc7fa7d
...
@@ -127,6 +127,42 @@ SES_Alloc(void)
...
@@ -127,6 +127,42 @@ SES_Alloc(void)
return
(
sp
);
return
(
sp
);
}
}
/*--------------------------------------------------------------------
* The pool-task function for sessions
*/
void
SES_pool_task
(
struct
pool
*
pp
,
struct
worker
*
wrk
,
void
*
arg
)
{
struct
sess
*
sp
;
AN
(
pp
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CAST_OBJ_NOTNULL
(
sp
,
arg
,
SESS_MAGIC
);
AZ
(
wrk
->
ws
->
r
);
wrk
->
lastused
=
NAN
;
THR_SetSession
(
sp
);
// AZ(wrk->sp);
// wrk->sp = sp;
AZ
(
sp
->
wrk
);
sp
->
wrk
=
wrk
;
CNT_Session
(
sp
);
sp
=
NULL
;
/* Cannot access sp now */
THR_SetSession
(
NULL
);
wrk
->
sp
=
NULL
;
WS_Assert
(
wrk
->
ws
);
AZ
(
wrk
->
busyobj
);
AZ
(
wrk
->
wrw
.
wfd
);
assert
(
wrk
->
wlp
==
wrk
->
wlb
);
if
(
cache_param
->
diag_bitmap
&
0x00040000
)
{
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
* Schedule a session back on a work-thread from its pool
* Schedule a session back on a work-thread from its pool
*/
*/
...
...
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