Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
4ff8ec30
Commit
4ff8ec30
authored
May 07, 1999
by
Ulrich Drepper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(class basic_string::Rep): Make release member function thread-safe for
ix86 (x>=4) and UltraSPARC. From-SVN: r26820
parent
199343c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
libstdc++/std/bastring.h
+27
-0
No files found.
libstdc++/std/bastring.h
View file @
4ff8ec30
...
...
@@ -73,7 +73,34 @@ private:
charT
*
data
()
{
return
reinterpret_cast
<
charT
*>
(
this
+
1
);
}
charT
&
operator
[]
(
size_t
s
)
{
return
data
()
[
s
];
}
charT
*
grab
()
{
if
(
selfish
)
return
clone
();
++
ref
;
return
data
();
}
#if defined __i486__ || defined __i586__ || defined __i686__
void
release
()
{
size_t
__val
;
asm
(
"lock; xaddl %0, %2"
:
"=r"
(
__val
)
:
"0"
(
-
1
),
"m"
(
ref
)
:
"memory"
);
if
(
__val
==
1
)
delete
this
;
}
#elif defined __sparcv9__
void
release
()
{
size_t
__newval
,
__oldval
=
ref
;
do
{
__newval
=
__oldval
-
1
;
__asm__
(
"cas [%4], %2, %0"
:
"=r"
(
__oldval
),
"=m"
(
ref
)
:
"r"
(
__oldval
),
"m"
(
ref
),
"r"
(
&
(
ref
)),
"0"
(
__newval
));
}
while
(
__newval
!=
__oldval
);
if
(
__oldval
==
0
)
delete
this
;
}
#else
void
release
()
{
if
(
--
ref
==
0
)
delete
this
;
}
#endif
inline
static
void
*
operator
new
(
size_t
,
size_t
);
inline
static
void
operator
delete
(
void
*
);
...
...
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