Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d7f50df6
Kaydet (Commit)
d7f50df6
authored
Ock 28, 2011
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
further simplify old-style interlocked inc/dec
üst
5b3360fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
26 deletions
+14
-26
interlck.c
sal/osl/unx/interlck.c
+14
-26
No files found.
sal/osl/unx/interlck.c
Dosyayı görüntüle @
d7f50df6
...
@@ -46,52 +46,40 @@ extern int osl_isSingleCPU;
...
@@ -46,52 +46,40 @@ extern int osl_isSingleCPU;
/*****************************************************************************/
/*****************************************************************************/
oslInterlockedCount
SAL_CALL
osl_incrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
oslInterlockedCount
SAL_CALL
osl_incrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
{
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
// Fast case for old, slow, single CPU Intel machines for whom
// interlocking is a performance nightmare.
if
(
osl_isSingleCPU
)
{
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
nCount
=
1
;
nCount
=
1
;
if
(
osl_isSingleCPU
)
{
__asm__
__volatile__
(
__asm__
__volatile__
(
"xaddl %0, %1
\n\t
"
"xaddl %0, %1
\n\t
"
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
/* nothing */
:
/* nothing */
:
"memory"
);
:
"memory"
);
return
++
nCount
;
}
}
else
{
else
__asm__
__volatile__
(
return
__sync_add_and_fetch
(
pCount
,
1
);
"lock
\n\t
"
"xaddl %0, %1
\n\t
"
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
/* nothing */
:
"memory"
);
}
return
++
nCount
;
}
}
oslInterlockedCount
SAL_CALL
osl_decrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
oslInterlockedCount
SAL_CALL
osl_decrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
{
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
if
(
osl_isSingleCPU
)
{
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
nCount
=
-
1
;
nCount
=
-
1
;
if
(
osl_isSingleCPU
)
{
__asm__
__volatile__
(
__asm__
__volatile__
(
"xaddl %0, %1
\n\t
"
"xaddl %0, %1
\n\t
"
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
/* nothing */
:
/* nothing */
:
"memory"
);
:
"memory"
);
return
--
nCount
;
}
}
else
{
else
__asm__
__volatile__
(
return
__sync_sub_and_fetch
(
pCount
,
1
);
"lock
\n\t
"
"xaddl %0, %1
\n\t
"
:
"+r"
(
nCount
),
"+m"
(
*
pCount
)
:
/* nothing */
:
"memory"
);
}
return
--
nCount
;
}
}
#elif defined ( GCC )
#elif defined ( GCC )
...
...
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