Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3a660c55
Commit
3a660c55
authored
Jan 14, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp/WorkQueue: remove unused attributes "high", "low"
parent
73899149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
WorkQueue.hxx
src/db/upnp/WorkQueue.hxx
+3
-17
No files found.
src/db/upnp/WorkQueue.hxx
View file @
3a660c55
...
...
@@ -48,8 +48,6 @@ template <class T>
class
WorkQueue
{
// Configuration
const
std
::
string
name
;
const
size_t
high
;
const
size_t
low
;
// Status
// Worker threads having called exit
...
...
@@ -72,8 +70,8 @@ public:
* meaning no limit. hi == -1 means that the queue is disabled.
* @param lo minimum count of tasks before worker starts. Default 1.
*/
WorkQueue
(
const
char
*
_name
,
size_t
hi
=
0
,
size_t
lo
=
1
)
:
name
(
_name
),
high
(
hi
),
low
(
lo
),
WorkQueue
(
const
char
*
_name
)
:
name
(
_name
),
n_workers_exited
(
0
),
ok
(
false
),
n_threads
(
0
),
threads
(
nullptr
)
...
...
@@ -124,13 +122,6 @@ public:
{
const
ScopeLock
protect
(
mutex
);
while
(
ok
&&
high
>
0
&&
queue
.
size
()
>=
high
)
{
// Keep the order: we test ok AFTER the sleep...
client_cond
.
wait
(
mutex
);
if
(
!
ok
)
return
false
;
}
queue
.
push
(
t
);
// Just wake one worker, there is only one new task.
...
...
@@ -180,9 +171,7 @@ public:
if
(
!
ok
)
return
false
;
while
(
ok
&&
queue
.
size
()
<
low
)
{
if
(
queue
.
empty
())
client_cond
.
broadcast
();
while
(
queue
.
empty
())
{
worker_cond
.
wait
(
mutex
);
if
(
!
ok
)
return
false
;
...
...
@@ -190,9 +179,6 @@ public:
tp
=
queue
.
front
();
queue
.
pop
();
// No reason to wake up more than one client thread
client_cond
.
signal
();
return
true
;
}
...
...
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