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
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
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 Archive
Alchemy Viewer
Commits
e2eca610
Commit
e2eca610
authored
11 years ago
by
simon
Browse files
Options
Downloads
Patches
Plain Diff
Revert LLThreadSafeRefCount optimization; caps fetching was failing. Reviewed by Kelly
parent
104f5764
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/llthread.h
+67
-1
67 additions, 1 deletion
indra/llcommon/llthread.h
indra/llui/llmodaldialog.h
+1
-1
1 addition, 1 deletion
indra/llui/llmodaldialog.h
with
68 additions
and
2 deletions
indra/llcommon/llthread.h
+
67
−
1
View file @
e2eca610
...
...
@@ -225,6 +225,71 @@ void LLThread::unlockData()
// see llmemory.h for LLPointer<> definition
#if (1) // Old code - see comment below
class
LL_COMMON_API
LLThreadSafeRefCount
{
public:
static
void
initThreadSafeRefCount
();
// creates sMutex
static
void
cleanupThreadSafeRefCount
();
// destroys sMutex
private:
static
LLMutex
*
sMutex
;
protected:
virtual
~
LLThreadSafeRefCount
();
// use unref()
public:
LLThreadSafeRefCount
();
LLThreadSafeRefCount
(
const
LLThreadSafeRefCount
&
);
LLThreadSafeRefCount
&
operator
=
(
const
LLThreadSafeRefCount
&
ref
)
{
if
(
sMutex
)
{
sMutex
->
lock
();
}
mRef
=
0
;
if
(
sMutex
)
{
sMutex
->
unlock
();
}
return
*
this
;
}
void
ref
()
{
if
(
sMutex
)
sMutex
->
lock
();
mRef
++
;
if
(
sMutex
)
sMutex
->
unlock
();
}
S32
unref
()
{
llassert
(
mRef
>=
1
);
if
(
sMutex
)
sMutex
->
lock
();
S32
res
=
--
mRef
;
if
(
sMutex
)
sMutex
->
unlock
();
if
(
0
==
res
)
{
delete
this
;
return
0
;
}
return
res
;
}
S32
getNumRefs
()
const
{
return
mRef
;
}
private
:
S32
mRef
;
};
#else
// New code - This was from https://bitbucket.org/lindenlab/viewer-cat/commits/b03bb43e4ead57f904cb3c1e9745dc8460de6efc
// and attempts
class
LL_COMMON_API
LLThreadSafeRefCount
{
public:
...
...
@@ -263,7 +328,7 @@ public:
// so that two threads who get into the if in parallel
// don't both attempt to the delete.
//
mRef
--
;
mRef
--
;
// Simon: why not if (mRef == 1) delete this; ? There still seems to be a window where mRef could be modified
if
(
mRef
==
0
)
delete
this
;
if
(
sMutex
)
sMutex
->
unlock
();
...
...
@@ -280,6 +345,7 @@ public:
private
:
LLAtomic32
<
S32
>
mRef
;
};
#endif // new code
/**
* intrusive pointer support for LLThreadSafeRefCount
...
...
This diff is collapsed.
Click to expand it.
indra/llui/llmodaldialog.h
+
1
−
1
View file @
e2eca610
...
...
@@ -40,7 +40,7 @@ class LLModalDialog : public LLFloater
{
public:
LLModalDialog
(
const
LLSD
&
key
,
BOOL
modal
=
true
);
/*
virtual
*/
~
LLModalDialog
();
virtual
~
LLModalDialog
();
/*virtual*/
BOOL
postBuild
();
...
...
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