Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
aaeb8a24
Commit
aaeb8a24
authored
2 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Tweak texture decode thread behavior to not choke"
This reverts commit
22d62720
.
parent
6af7373a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llimage/llimageworker.cpp
+20
-25
20 additions, 25 deletions
indra/llimage/llimageworker.cpp
with
20 additions
and
25 deletions
indra/llimage/llimageworker.cpp
+
20
−
25
View file @
aaeb8a24
...
@@ -35,8 +35,7 @@ std::atomic< U32 > sImageThreads = 0;
...
@@ -35,8 +35,7 @@ std::atomic< U32 > sImageThreads = 0;
class
PoolWorkerThread
final
:
public
LLThread
class
PoolWorkerThread
final
:
public
LLThread
{
{
public:
public:
PoolWorkerThread
(
std
::
string
name
)
:
LLThread
(
name
),
PoolWorkerThread
(
std
::
string
name
)
:
LLThread
(
name
),
mRequestQueue
(
512
)
mCurrentRequest
(
NULL
)
{
{
}
}
...
@@ -44,40 +43,36 @@ class PoolWorkerThread final : public LLThread
...
@@ -44,40 +43,36 @@ class PoolWorkerThread final : public LLThread
{
{
while
(
!
isQuitting
())
while
(
!
isQuitting
())
{
{
auto
*
pReq
=
mCurrentRequest
.
exchange
(
nullptr
);
checkPause
();
if
(
pReq
)
LLImageDecodeThread
::
ImageRequest
*
req
=
nullptr
;
pReq
->
processRequestIntern
();
while
(
!
isQuitting
()
&&
mRequestQueue
.
tryPop
(
req
))
checkPause
();
{
if
(
req
)
{
req
->
processRequestIntern
();
}
}
}
}
}
}
bool
isBusy
()
{
auto
*
pReq
=
mCurrentRequest
.
load
();
if
(
!
pReq
)
return
false
;
auto
status
=
pReq
->
getStatus
();
return
status
==
LLQueuedThread
::
STATUS_QUEUED
||
status
==
LLQueuedThread
::
STATUS_INPROGRESS
;
}
bool
runCondition
()
bool
runCondition
()
{
{
return
mCurrentRequest
!=
NULL
;
return
mRequestQueue
.
size
()
>
0
;
}
}
bool
setRequest
(
LLImageDecodeThread
::
ImageRequest
*
req
)
bool
setRequest
(
LLImageDecodeThread
::
ImageRequest
*
req
)
{
{
LLImageDecodeThread
::
ImageRequest
*
pOld
{
nullptr
};
bool
bSuccess
=
mRequestQueue
.
tryPush
(
req
);
bool
bSuccess
=
mCurrentRequest
.
compare_exchange_strong
(
pOld
,
req
);
if
(
bSuccess
)
wake
();
{
wake
();
}
return
bSuccess
;
return
bSuccess
;
}
}
private
:
private
:
std
::
atomic
<
LLImageDecodeThread
::
ImageRequest
*>
m
Current
Request
;
LLThreadSafeQueue
<
LLImageDecodeThread
::
ImageRequest
*>
mRequest
Queue
;
};
};
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
...
@@ -356,7 +351,7 @@ bool LLImageDecodeThread::enqueRequest(ImageRequest * req)
...
@@ -356,7 +351,7 @@ bool LLImageDecodeThread::enqueRequest(ImageRequest * req)
mLastPoolAllocation
=
0
;
mLastPoolAllocation
=
0
;
}
}
auto
&
thread
=
mThreadPool
[
mLastPoolAllocation
++
];
auto
&
thread
=
mThreadPool
[
mLastPoolAllocation
++
];
if
(
!
thread
->
isBusy
()
&&
thread
->
setRequest
(
req
))
if
(
thread
->
setRequest
(
req
))
{
{
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment