Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
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
esp
mongoose
Commits
4cf78519
Commit
4cf78519
authored
Jul 06, 2010
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decreased thread idle time to 5 seconds. exiting worker thread if stop flag is raised.
parent
9a2b2d75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mongoose.c
mongoose.c
+2
-2
No files found.
mongoose.c
View file @
4cf78519
...
@@ -3576,7 +3576,7 @@ static bool_t get_socket(struct mg_context *ctx, struct socket *sp) {
...
@@ -3576,7 +3576,7 @@ static bool_t get_socket(struct mg_context *ctx, struct socket *sp) {
ctx
->
num_idle
++
;
ctx
->
num_idle
++
;
while
(
ctx
->
sq_head
==
ctx
->
sq_tail
)
{
while
(
ctx
->
sq_head
==
ctx
->
sq_tail
)
{
ts
.
tv_nsec
=
0
;
ts
.
tv_nsec
=
0
;
ts
.
tv_sec
=
time
(
NULL
)
+
10
;
ts
.
tv_sec
=
time
(
NULL
)
+
5
;
if
(
pthread_cond_timedwait
(
&
ctx
->
empty_cond
,
&
ctx
->
mutex
,
&
ts
)
!=
0
)
{
if
(
pthread_cond_timedwait
(
&
ctx
->
empty_cond
,
&
ctx
->
mutex
,
&
ts
)
!=
0
)
{
// Timeout! release the mutex and return
// Timeout! release the mutex and return
(
void
)
pthread_mutex_unlock
(
&
ctx
->
mutex
);
(
void
)
pthread_mutex_unlock
(
&
ctx
->
mutex
);
...
@@ -3615,7 +3615,7 @@ static void worker_thread(struct mg_context *ctx) {
...
@@ -3615,7 +3615,7 @@ static void worker_thread(struct mg_context *ctx) {
(
void
)
memset
(
&
conn
,
0
,
sizeof
(
conn
));
(
void
)
memset
(
&
conn
,
0
,
sizeof
(
conn
));
while
(
get_socket
(
ctx
,
&
conn
.
client
)
==
TRUE
)
{
while
(
ctx
->
stop_flag
==
0
&&
get_socket
(
ctx
,
&
conn
.
client
)
==
TRUE
)
{
conn
.
birth_time
=
time
(
NULL
);
conn
.
birth_time
=
time
(
NULL
);
conn
.
ctx
=
ctx
;
conn
.
ctx
=
ctx
;
...
...
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